1 // File: ModuleBase_Widgets.h
2 // Created: 04 June 2014
3 // Author: Vitaly Smetannikov
5 #ifndef ModuleBase_Widgets_H
6 #define ModuleBase_Widgets_H
8 #include "ModuleBase.h"
9 #include "ModuleBase_ModelWidget.h"
11 class Config_WidgetAPI;
17 class MODULEBASE_EXPORT ModuleBase_DoubleValueWidget: public ModuleBase_ModelWidget
21 ModuleBase_DoubleValueWidget(QWidget* theParent, const Config_WidgetAPI* theData);
23 virtual ~ModuleBase_DoubleValueWidget();
25 /// Saves the internal parameters to the given feature
26 /// \param theFeature a model feature to be changed
27 virtual bool storeValue(FeaturePtr theFeature) const;
29 virtual bool restoreValue(FeaturePtr theFeature);
31 /// Returns list of widget controls
32 /// \return a control list
33 virtual QList<QWidget*> getControls() const;
35 /// Returns the internal parent wiget control, that can be shown anywhere
36 /// \returns the widget
37 QWidget* getControl() const { return myContainer; }
40 std::string myAttributeID;
44 QDoubleSpinBox* mySpinBox;
48 //////////////////////////////////////////////////////////////////////////////////
50 class MODULEBASE_EXPORT ModuleBase_BoolValueWidget: public ModuleBase_ModelWidget
54 ModuleBase_BoolValueWidget(QWidget* theParent, const Config_WidgetAPI* theData);
56 virtual ~ModuleBase_BoolValueWidget();
58 /// Saves the internal parameters to the given feature
59 /// \param theFeature a model feature to be changed
60 virtual bool storeValue(FeaturePtr theFeature) const;
62 virtual bool restoreValue(FeaturePtr theFeature);
64 /// Returns list of widget controls
65 /// \return a control list
66 virtual QList<QWidget*> getControls() const;
68 /// Returns the internal parent wiget control, that can be shown anywhere
69 /// \returns the widget
70 QWidget* getControl() const;
73 std::string myAttributeID;
75 QCheckBox* myCheckBox;