CDocumentMetaInfoEditorComp.h
Go to the documentation of this file.
1 #ifndef iqtdoc_CDocumentMetaInfoEditorComp_included
2 #define iqtdoc_CDocumentMetaInfoEditorComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QtGlobal>
7 #if QT_VERSION >= 0x050000
8 #include <QtWidgets/QLabel>
9 #include <QtWidgets/QLineEdit>
10 #else
11 #include <QtGui/QLabel>
12 #include <QtGui/QLineEdit>
13 #endif
14 
15 // ACF includes
16 #include <idoc/IDocumentMetaInfo.h>
20 
21 
22 namespace iqtdoc
23 {
24 
25 
28  iqtgui::TGuiComponentBase<QWidget>,
29  imod::TSingleModelObserverBase<idoc::IDocumentMetaInfo> >
30 {
31  Q_OBJECT
32 public:
36 
37  I_BEGIN_COMPONENT(CDocumentMetaInfoEditorComp);
38  I_END_COMPONENT;
39 
40 protected:
41  // reimplemented (iqtgui::TGuiObserverWrap)
42  virtual void OnGuiModelAttached();
43  virtual void OnGuiModelDetached();
44  virtual void UpdateGui(const istd::IChangeable::ChangeSet& changeSet);
45 
46  // reimplemented (iqtgui::CComponentBase)
47  virtual void OnGuiCreated();
48 
49 protected Q_SLOTS:
50  void OnItemEditingFinished();
51 
52 private:
53  void ResetItems();
54 
55 private:
56  struct MetaInfoItem
57  {
58  MetaInfoItem()
59  :labelPtr(NULL),
60  editPtr(NULL)
61  {
62  }
63 
64  QLabel* labelPtr;
65  QLineEdit* editPtr;
66  };
67 
68  typedef QMap<int, MetaInfoItem> MetaInfoItemsMap;
69 
70  MetaInfoItemsMap m_metaInfoItemsMap;
71 };
72 
73 
74 } // namespace iqtdoc
75 
76 
77 #endif // !iqtdoc_CDocumentMetaInfoEditorComp_included
78 
79 
Join functionality of iqtgui::IGuiObject interface and imod::IObserver.
virtual void UpdateGui(const istd::IChangeable::ChangeSet &changeSet)
Do update of the GUI to reflect the state of model.
virtual void OnGuiModelAttached()
Called when model is attached and GUI is created.
#define NULL
Definition: istd.h:64
virtual void OnGuiCreated()
Called just after GUI is initialized.
Set of change flags (its IDs).
Definition: IChangeable.h:30
virtual void OnGuiModelDetached()
Called when model is detached or GUI is destroyed.
iqtgui::TGuiObserverWrap< iqtgui::TGuiComponentBase< QWidget >, imod::TSingleModelObserverBase< idoc::IDocumentMetaInfo > > BaseClass

© 2007-2017 Witold Gantzke and Kirill Lepskiy