Salome HOME
caab1955678fb6350606ba9f138f2afb33574aac
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetDoubleValue.h
1 // File:        ModuleBase_WidgetDoubleValue.h
2 // Created:     04 June 2014
3 // Author:      Vitaly Smetannikov
4
5 #ifndef ModuleBase_WidgetDoubleValue_H
6 #define ModuleBase_WidgetDoubleValue_H
7
8 #include "ModuleBase.h"
9 #include "ModuleBase_ModelWidget.h"
10
11 class Config_WidgetAPI;
12 class QWidget;
13 class QLabel;
14 class QDoubleSpinBox;
15 class QCheckBox;
16
17 class MODULEBASE_EXPORT ModuleBase_WidgetDoubleValue: public ModuleBase_ModelWidget
18 {
19   Q_OBJECT
20 public:
21   ModuleBase_WidgetDoubleValue(QWidget* theParent, const Config_WidgetAPI* theData);
22
23   virtual ~ModuleBase_WidgetDoubleValue();
24
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;
28
29   virtual bool restoreValue(FeaturePtr theFeature);
30
31   /// Returns list of widget controls
32   /// \return a control list
33   virtual QList<QWidget*> getControls() const;
34
35   /// Returns the internal parent wiget control, that can be shown anywhere
36   /// \returns the widget
37   QWidget* getControl() const { return myContainer; }
38
39 private:
40   std::string myAttributeID;
41   
42   QWidget*     myContainer;
43   QLabel*      myLabel;
44   QDoubleSpinBox* mySpinBox;
45 };
46
47 #endif