ICF 3.1.1.10
Technical documentation of ICF Libraries
CNumericParamsGuiComp.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#ifndef iqtmeas_CNumericParamsGuiComp_included
7#define iqtmeas_CNumericParamsGuiComp_included
8
9
10// Qt includes
11#include<QtCore/QtGlobal>
12#include <QtWidgets/QFrame>
13#include <QtWidgets/QGroupBox>
14
15// ICF includes
16#include <istd/TPointerVector.h>
17#include <imod/TModelWrap.h>
20#include <imeas/INumericValue.h>
22
23
24namespace imeasgui
25{
26
27
30 istdgui::TGuiComponentBase<QWidget>,
31 imod::TSingleModelObserverBase<imeas::INumericValue> >,
33{
34 Q_OBJECT
35public:
40
41 I_BEGIN_COMPONENT(CNumericParamsGuiComp);
42 I_REGISTER_INTERFACE(imod::IModelEditor);
43 I_ASSIGN(m_isSliderVisibleAttrPtr, "SliderVisible", "Enables slider control", true, true);
44 I_ASSIGN(m_isButtonsVisibleAttrPtr, "ButtonsVisible", "Enables min/max buttons", true, true);
45 I_ASSIGN(m_isSingleRowAttrPtr, "SingleRow", "Single row layout", true, false);
46 I_ASSIGN(m_inputPolicyAttrPtr, "InputSizePolicy", "0 - minimal width (default)\n1 - expanding input \n2 - label and input have same width", false, 0);
47 I_ASSIGN(m_verticalLayoutAttrPtr, "VerticalLayout", "Vertical or horizontal layout for multiple widgets", true, true);
48 I_ASSIGN(m_editorPrecisionAttrPtr, "EditorPrecision", "Precision of the spin editor (-1 - don't change, 0 - integer, 1 - one decimal etc.)", true, 2);
49 I_ASSIGN(m_postValidationEnabledAttrPtr, "PostValidationEnabled", "If enabled, the constraints check will be done after finishing editing of value", true, false);
50 I_END_COMPONENT;
51
53
54protected:
55 // reimplemented (istdgui::TGuiObserverWrap)
56 void OnGuiModelAttached() override;
57 void OnGuiModelDetached() override;
58 void UpdateModel() const override;
59 void UpdateGui(const istd::IChangeable::ChangeSet& changeSet) override;
60
61 // reimplemented (istdgui::CGuiComponentBase)
62 void OnGuiCreated() override;
63 void OnGuiDestroyed() override;
64
65 // reimplemented (imod::CMultiModelDispatcherBase)
66 void OnModelChanged(int modelId, const istd::IChangeable::ChangeSet& changeSet) override;
67
68public Q_SLOTS:
70
71private:
72 I_ATTR(bool, m_isSliderVisibleAttrPtr);
73 I_ATTR(bool, m_isButtonsVisibleAttrPtr);
74 I_ATTR(bool, m_isSingleRowAttrPtr);
75 I_ATTR(int, m_inputPolicyAttrPtr);
76 I_ATTR(bool, m_verticalLayoutAttrPtr);
77 I_ATTR(int, m_editorPrecisionAttrPtr);
78 I_ATTR(bool, m_postValidationEnabledAttrPtr);
79
81};
82
83
84} // namespace imeasgui
85
86
87#endif // !iqtmeas_CNumericParamsGuiComp_included
88
89
istdgui::TGuiObserverWrap< istdgui::TGuiComponentBase< QWidget >, imod::TSingleModelObserverBase< imeas::INumericValue > > BaseClass
imod::CMultiModelDispatcherBase BaseClass2
void UpdateGui(const istd::IChangeable::ChangeSet &changeSet) override
Do update of the GUI to reflect the state of model.
void OnGuiModelDetached() override
Called when model is detached or GUI is destroyed.
void OnGuiCreated() override
Called just after GUI is initialized.
void OnModelChanged(int modelId, const istd::IChangeable::ChangeSet &changeSet) override
Called when some model observed by dispatcher will be changed.
void UpdateModel() const override
Do update of the model to reflect the current contents of GUI.
void OnGuiModelAttached() override
Called when model is attached and GUI is created.
void OnGuiDestroyed() override
Called just before GUI is released.
Generic implementation of a data model changes notifier.
Common interface for an model editor.
Basic implementation for a single model observer with binding to concrete data object interface.
Set of change flags (its IDs).
Definition IChangeable.h:38
Implementation of a pointer container, which controls the live cycle of the pointer object.
Base class for all Qt GUI componentes.
Join functionality of istdgui::IGuiObject interface and imod::IObserver.
This package contains Qt based implementations of measurement components.

© Witold Gantzke and Kirill Lepskiy