VR-Forces 4.10 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 
9 
10 #ifndef DtCustomTreeWidgetEditor_H_
11 #define DtCustomTreeWidgetEditor_H_
12 
13 #include <vrvCoreQt/vrvCoreQt.h>
14 #include <QtCore/QObject>
15 #include <QtCore/QStringList>
16 #include <QtWidgets/QTreeWidgetItem>
17 
18 class QTreeWidgetItem;
19 
20 namespace makVrv
21 {
22 
23  class DtDe;
24 
28  {
29  Q_OBJECT;
30  public:
31 
33  {
34  DefaultEditor = 0,
41  Boolean
42  };
43 
44  DtCustomTreeWidgetEditor(DtDe& de, QTreeWidgetItem* item,int index, QString value,
45  EditorType type = LineEdit);
46 
47  virtual ~DtCustomTreeWidgetEditor();
48 
49  virtual void setComboBoxParameters(QStringList* possibleValues,bool noEditing = true);
50 
51  virtual void setValue( QString value );
52 
53  bool editing();
54 
55  public slots:
56 
57  void edit();
58  void commit();
59  void updateValue( QString value );
60 
61  virtual void editAsTextBox();
62  virtual void editAsLineEdit();
63  virtual void editAsComboBox();
64  virtual void editAsFileBrowser();
65  virtual void editAsBoolComboBox();
66 
67  /*
68  virtual void editAsFileName();
69  virtual void editAsInteger();
70  virtual void editAsFloatingPoint();
71  */
72 
73  virtual QString commitFromTextBox();
74  virtual QString commitFromLineEdit();
75  virtual QString commitFromComboBox();
76  virtual QString commitFromFileBrowser();
77  virtual QString commitFromBoolComboBox();
78 
79  protected:
80 
81  virtual bool eventFilter(QObject *obj, QEvent *event);
82 
83  protected:
84 
88  QString myInitialValue;
89  int myIndex;
90  QStringList* myComboBoxParameters;
92 
93  };
94 
98  {
99 
100  public:
101 
102  typedef std::map<int, DtCustomTreeWidgetEditor::EditorType> EditorTypeMap;
103 
104  DtCustomTreeWidgetItem(DtDe& de, QTreeWidget* parent, int type = QTreeWidgetItem::Type);
105 
106  virtual ~DtCustomTreeWidgetItem();
107 
108  virtual void setData(int column, int role, const QVariant &value);
109  virtual void setColumnEditorType(int column, DtCustomTreeWidgetEditor::EditorType editorType);
110 
111  //May only be called after setText on the column.
112  virtual void setComboBoxParameters(int column, QStringList* comboBoxParameters);
113 
114  void edit(int column);
115 
118  virtual bool operator<(const QTreeWidgetItem &other) const;
119 
120  protected:
121 
124 
125  };
126 }
127 
128 #endif
129 
EditorType myType
Definition: DtCustomTreeWidgetEditor.h:86
EditorTypeMap myEditorTypeMap
Definition: DtCustomTreeWidgetEditor.h:122
DtDe & myDe
Definition: DtCustomTreeWidgetEditor.h:123
DtDe & myDe
Definition: DtCustomTreeWidgetEditor.h:85
EditorType
Definition: DtCustomTreeWidgetEditor.h:32
bool myComboBoxEditable
Definition: DtCustomTreeWidgetEditor.h:91
QStringList * myComboBoxParameters
Definition: DtCustomTreeWidgetEditor.h:90
std::map< int, DtCustomTreeWidgetEditor::EditorType > EditorTypeMap
Definition: DtCustomTreeWidgetEditor.h:102
#define DT_DLL_VRVCOREQT
Definition: vrvCoreQt.h:20
Contains DLL export macros.
Editor for various types within a QTreeWidget.
Definition: DtCustomTreeWidgetEditor.h:27
Definition: DtCustomTreeWidgetEditor.h:37
QTreeWidgetItem * myItem
Definition: DtCustomTreeWidgetEditor.h:87
Definition: DtCustomTreeWidgetEditor.h:36
Definition: DtCustomTreeWidgetEditor.h:35
QString myInitialValue
Definition: DtCustomTreeWidgetEditor.h:88
Definition: DtCustomTreeWidgetEditor.h:40
A custom tree widget item which allows for custom editing.
Definition: DtCustomTreeWidgetEditor.h:97
Definition: DtCustomTreeWidgetEditor.h:39
int myIndex
Definition: DtCustomTreeWidgetEditor.h:89
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
Definition: DtCustomTreeWidgetEditor.h:38

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)