VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 <QtGui/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,
43  TextBox
44  };
45 
46  DtCustomTreeWidgetEditor(DtDe& de, QTreeWidgetItem* item,int index, QString value,
47  EditorType type = LineEdit);
48 
49  virtual ~DtCustomTreeWidgetEditor();
50 
51  virtual void setComboBoxParameters(QStringList* possibleValues,bool noEditing = true);
52 
53  virtual void setValue( QString value );
54 
55  bool editing();
56 
57  public slots:
58 
59  void edit();
60  void commit();
61  void updateValue( QString value );
62 
63  virtual void editAsTextBox();
64  virtual void editAsLineEdit();
65  virtual void editAsComboBox();
66  virtual void editAsFileBrowser();
67 
68  /*
69  virtual void editAsFileName();
70  virtual void editAsInteger();
71  virtual void editAsFloatingPoint();
72  */
73 
74  virtual QString commitFromTextBox();
75  virtual QString commitFromLineEdit();
76  virtual QString commitFromComboBox();
77  virtual QString commitFromFileBrowser();
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 

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)