VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCustomTreeWidgetEditor.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtCustomTreeWidgetEditor.h,v $ $Revision: 1.15 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #ifndef DtCustomTreeWidgetEditor_H_
14 #define DtCustomTreeWidgetEditor_H_
15 
16 #include <vrvCoreQt/vrvCoreQt.h>
17 #include <QtCore/QObject>
18 #include <QtCore/QStringList>
19 #include <QtWidgets/QTreeWidgetItem>
20 
21 class QTreeWidgetItem;
22 
23 namespace makVrv
24 {
25 
26  class DtDe;
27 
31  {
32  Q_OBJECT;
33  public:
34 
36  {
37  DefaultEditor = 0,
44  Boolean
45  };
46 
47  DtCustomTreeWidgetEditor(DtDe& de, QTreeWidgetItem* item,int index, QString value,
48  EditorType type = LineEdit);
49 
50  virtual ~DtCustomTreeWidgetEditor();
51 
52  virtual void setComboBoxParameters(QStringList* possibleValues,bool noEditing = true);
53 
54  virtual void setValue( QString value );
55 
56  bool editing();
57 
58  public slots:
59 
60  void edit();
61  void commit();
62  void updateValue( QString value );
63 
64  virtual void editAsTextBox();
65  virtual void editAsLineEdit();
66  virtual void editAsComboBox();
67  virtual void editAsFileBrowser();
68  virtual void editAsBoolComboBox();
69 
70  /*
71  virtual void editAsFileName();
72  virtual void editAsInteger();
73  virtual void editAsFloatingPoint();
74  */
75 
76  virtual QString commitFromTextBox();
77  virtual QString commitFromLineEdit();
78  virtual QString commitFromComboBox();
79  virtual QString commitFromFileBrowser();
80  virtual QString commitFromBoolComboBox();
81 
82  protected:
83 
84  virtual bool eventFilter(QObject *obj, QEvent *event);
85 
86  protected:
87 
91  QString myInitialValue;
92  int myIndex;
93  QStringList* myComboBoxParameters;
95 
96  };
97 
101  {
102 
103  public:
104 
105  typedef std::map<int, DtCustomTreeWidgetEditor::EditorType> EditorTypeMap;
106 
107  DtCustomTreeWidgetItem(DtDe& de, QTreeWidget* parent, int type = QTreeWidgetItem::Type);
108 
109  virtual ~DtCustomTreeWidgetItem();
110 
111  virtual void setData(int column, int role, const QVariant &value);
112  virtual void setColumnEditorType(int column, DtCustomTreeWidgetEditor::EditorType editorType);
113 
114  //May only be called after setText on the column.
115  virtual void setComboBoxParameters(int column, QStringList* comboBoxParameters);
116 
117  void edit(int column);
118 
121  virtual bool operator<(const QTreeWidgetItem &other) const;
122 
123  protected:
124 
127 
128  };
129 }
130 
131 #endif
132 

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)