Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[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 ModuleBase_DoubleSpinBox;
12 class Config_WidgetAPI;
13 class QWidget;
14 class QLabel;
15 class QTimer;
16
17 class MODULEBASE_EXPORT ModuleBase_WidgetDoubleValue : public ModuleBase_ModelWidget
18 {
19 Q_OBJECT
20  public:
21   /// Constructor
22   /// \theParent the parent object
23   /// \theData the widget configuation. The attribute of the model widget is obtained from
24   ModuleBase_WidgetDoubleValue(QWidget* theParent, const Config_WidgetAPI* theData,
25                                const std::string& theParentId);
26
27   virtual ~ModuleBase_WidgetDoubleValue();
28
29   /// Saves the internal parameters to the given feature
30   /// \param theObject a model feature to be changed
31   virtual bool storeValue() const;
32
33   virtual bool restoreValue();
34
35   /// Returns list of widget controls
36   /// \return a control list
37   virtual QList<QWidget*> getControls() const;
38
39   /// Returns the internal parent wiget control, that can be shown anywhere
40   /// \returns the widget
41   QWidget* getControl() const
42   {
43     return myContainer;
44   }
45
46  public slots:
47  /// Delayed value chnged: when user starts typing something,
48  // it gives him a 0,5 second to finish typing, when sends valueChnaged() signal
49 //  void onValueChanged();
50
51  protected:
52   QWidget* myContainer;
53   QLabel* myLabel;
54   ModuleBase_DoubleSpinBox* mySpinBox;
55 };
56
57 #endif