CNumericParamsGuiComp.h
Go to the documentation of this file.
1 #ifndef iqtmeas_CNumericParamsGuiComp_included
2 #define iqtmeas_CNumericParamsGuiComp_included
3 
4 
5 // Qt includes
6 #include<QtCore/QtGlobal>
7 #if QT_VERSION >= 0x050000
8 #include <QtWidgets/QFrame>
9 #include <QtWidgets/QGroupBox>
10 #else
11 #include <QtGui/QFrame>
12 #include <QtGui/QGroupBox>
13 #endif
14 
15 // ACF includes
16 #include <istd/TPointerVector.h>
17 #include <imod/TModelWrap.h>
20 
21 // ACF-Solutions includes
22 #include <imeas/INumericValue.h>
24 
25 
26 namespace iqtmeas
27 {
28 
29 
32  iqtgui::TGuiComponentBase<QWidget>,
33  imod::TSingleModelObserverBase<imeas::INumericValue> >,
35 {
36  Q_OBJECT
37 public:
42 
43  I_BEGIN_COMPONENT(CNumericParamsGuiComp);
44  I_REGISTER_INTERFACE(imod::IModelEditor);
45  I_ASSIGN(m_isSliderVisibleAttrPtr, "SliderVisible", "Enables slider control", true, true);
46  I_ASSIGN(m_isButtonsVisibleAttrPtr, "ButtonsVisible", "Enables min/max buttons", true, true);
47  I_ASSIGN(m_isSingleRowAttrPtr, "SingleRow", "Single row layout", true, false);
48  I_ASSIGN(m_inputPolicyAttrPtr, "InputSizePolicy", "0 - minimal width (default)\n1 - expanding input \n2 - label and input have same width", false, 0);
49  I_ASSIGN(m_verticalLayoutAttrPtr, "VerticalLayout", "Vertical or horizontal layout for multiple widgets", true, true);
50  I_ASSIGN(m_editorPrecisionAttrPtr, "EditorPrecision", "Precision of the spin editor (-1 - don't change, 0 - integer, 1 - one decimal etc.)", true, 2);
51  I_ASSIGN(m_postValidationEnabledAttrPtr, "PostValidationEnabled", "If enabled, the constraints check will be done after finishing editing of value", true, false);
52  I_END_COMPONENT;
53 
54  virtual ~CNumericParamsGuiComp();
55 
56 protected:
57  // reimplemented (iqtgui::TGuiObserverWrap)
58  virtual void OnGuiModelAttached();
59  virtual void OnGuiModelDetached();
60  virtual void UpdateModel() const;
61  virtual void UpdateGui(const istd::IChangeable::ChangeSet& changeSet);
62 
63  // reimplemented (iqtgui::CGuiComponentBase)
64  virtual void OnGuiCreated();
65  virtual void OnGuiDestroyed();
66 
67  // reimplemented (imod::CMultiModelDispatcherBase)
68  virtual void OnModelChanged(int modelId, const istd::IChangeable::ChangeSet& changeSet);
69 
70 public Q_SLOTS:
71  void OnValueChanged();
72 
73 private:
74  I_ATTR(bool, m_isSliderVisibleAttrPtr);
75  I_ATTR(bool, m_isButtonsVisibleAttrPtr);
76  I_ATTR(bool, m_isSingleRowAttrPtr);
77  I_ATTR(int, m_inputPolicyAttrPtr);
78  I_ATTR(bool, m_verticalLayoutAttrPtr);
79  I_ATTR(int, m_editorPrecisionAttrPtr);
80  I_ATTR(bool, m_postValidationEnabledAttrPtr);
81 
83 };
84 
85 
86 } // namespace iqtmeas
87 
88 
89 #endif // !iqtmeas_CNumericParamsGuiComp_included
90 
91 
iqtgui::TGuiObserverWrap< iqtgui::TGuiComponentBase< QWidget >, imod::TSingleModelObserverBase< imeas::INumericValue > > BaseClass
virtual void UpdateGui(const istd::IChangeable::ChangeSet &changeSet)
virtual void OnModelChanged(int modelId, const istd::IChangeable::ChangeSet &changeSet)
virtual void UpdateModel() const
imod::CMultiModelDispatcherBase BaseClass2

© 2007-2017 Witold Gantzke and Kirill Lepskiy