ACF $AcfVersion:0$
CDocumentMetaInfoEditorComp.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
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
20
21
22namespace iqtdoc
23{
24
25
28 iqtgui::TGuiComponentBase<QWidget>,
29 imod::TSingleModelObserverBase<idoc::IDocumentMetaInfo> >
30{
31 Q_OBJECT
32public:
36
37 I_BEGIN_COMPONENT(CDocumentMetaInfoEditorComp);
38 I_END_COMPONENT;
39
40protected:
41 // reimplemented (iqtgui::TGuiObserverWrap)
42 virtual void OnGuiModelAttached() override;
43 virtual void OnGuiModelDetached() override;
44 virtual void UpdateGui(const istd::IChangeable::ChangeSet& changeSet) override;
45
46 // reimplemented (iqtgui::CComponentBase)
47 virtual void OnGuiCreated() override;
48
49protected Q_SLOTS:
51
52private:
53 void ResetItems();
54
55private:
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
Basic implementation for a single model observer with binding to concrete data object interface.
virtual void OnGuiModelDetached() override
Called when model is detached or GUI is destroyed.
iqtgui::TGuiObserverWrap< iqtgui::TGuiComponentBase< QWidget >, imod::TSingleModelObserverBase< idoc::IDocumentMetaInfo > > BaseClass
virtual void OnGuiCreated() override
Called just after GUI is initialized.
virtual void UpdateGui(const istd::IChangeable::ChangeSet &changeSet) override
Do update of the GUI to reflect the state of model.
virtual void OnGuiModelAttached() override
Called when model is attached and GUI is created.
Base class for all Qt GUI componentes.
Join functionality of iqtgui::IGuiObject interface and imod::IObserver.
Set of change flags (its IDs).
Definition IChangeable.h:36
#define NULL
Definition istd.h:74
This package contains Qt implementations related to Document/View concept.