CPropertiesEditorComp.h
Go to the documentation of this file.
1 #ifndef iprop_CPropertiesEditorComp_included
2 #define iprop_CPropertiesEditorComp_included
3 
4 
5 // ACF includes
7 #include "iqtgui/CItemDelegate.h"
8 
9 // ACF-Solutions includes
11 
12 #include "GeneratedFiles/iprop/ui_CPropertiesEditorComp.h"
13 
14 
15 namespace iprop
16 {
17 
18 
24  Ui::CPropertiesEditorComp, IPropertiesManager>
25 {
26  Q_OBJECT
27 public:
29  Ui::CPropertiesEditorComp, IPropertiesManager> BaseClass;
30 
32  {
35  };
36 
37  enum DataRole
38  {
39  DR_PROPERTY_ID = Qt::UserRole + 1
40  };
41 
42  I_BEGIN_COMPONENT(CPropertiesEditorComp);
43  I_END_COMPONENT;
44 
45 protected:
46  // reimplemented (iqtgui::TGuiObserverWrap)
47  virtual void UpdateGui(int updateFlags = 0);
48 
49  // reimplemented (CGuiComponentBase)
50  virtual void OnGuiCreated();
51 
52 private:
53  class EditorDelegate: public iqtgui::CItemDelegate
54  {
55  public:
57 
58  // reimplemented (QItemDelegate)
59  virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& /*option*/, const QModelIndex& index) const;
60  virtual void setEditorData(QWidget* editor, const QModelIndex& index) const;
61  virtual void setModelData(QWidget* editor,QAbstractItemModel* model, const QModelIndex& index) const;
62  };
63 
64 private:
65  void UpdatePropertyEditor(
66  const IProperty& objectProperty,
67  const QString& propertyId,
68  const QString& propertyDescription);
69 
70  QString GetPropertyId(const QTreeWidgetItem& propertyItem) const;
71 
72  QTreeWidgetItem* FindPropertyItem(const QString& propertyId) const;
73 
74  void SetDataToEditor(const IProperty& objectProperty, QTreeWidgetItem& propertyItem);
75 };
76 
77 
78 } // namespace iqtgui
79 
80 
81 #endif // !iprop_CPropertiesEditorComp_included
82 
83 
virtual void UpdateGui(int updateFlags=0)
Tree view based property editor component.
Common interface for a container of properties.
iqtgui::TDesignerGuiObserverCompBase< Ui::CPropertiesEditorComp, IPropertiesManager > BaseClass

© 2007-2011 Witold Gantzke and Kirill Lepskiy