]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModuleBase/ModuleBase_WidgetDoubleValue.h
Salome HOME
Merge branch 'BR_PYTHON_PLUGIN' of newgeom:newgeom.git into Dev_0.6.1
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetDoubleValue.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModuleBase_WidgetDoubleValue.h
4 // Created:     04 June 2014
5 // Author:      Vitaly Smetannikov
6
7 #ifndef ModuleBase_WidgetDoubleValue_H
8 #define ModuleBase_WidgetDoubleValue_H
9
10 #include "ModuleBase.h"
11 #include "ModuleBase_ModelWidget.h"
12
13 class ModuleBase_DoubleSpinBox;
14 class Config_WidgetAPI;
15 class QWidget;
16 class QLabel;
17 class QTimer;
18
19 class MODULEBASE_EXPORT ModuleBase_WidgetDoubleValue : public ModuleBase_ModelWidget
20 {
21 Q_OBJECT
22  public:
23   /// Constructor
24   /// \theParent the parent object
25   /// \theData the widget configuation. The attribute of the model widget is obtained from
26   ModuleBase_WidgetDoubleValue(QWidget* theParent, const Config_WidgetAPI* theData,
27                                const std::string& theParentId);
28
29   virtual ~ModuleBase_WidgetDoubleValue();
30
31   /// Saves the internal parameters to the given feature
32   /// \param theObject a model feature to be changed
33   virtual bool storeValue() const;
34
35   virtual bool restoreValue();
36
37   /// Returns list of widget controls
38   /// \return a control list
39   virtual QList<QWidget*> getControls() const;
40
41   /// Returns the internal parent wiget control, that can be shown anywhere
42   /// \returns the widget
43   QWidget* getControl() const
44   {
45     return myContainer;
46   }
47
48  public slots:
49  /// Delayed value chnged: when user starts typing something,
50  // it gives him a 0,5 second to finish typing, when sends valueChnaged() signal
51 //  void onValueChanged();
52
53  protected:
54   QWidget* myContainer;
55   QLabel* myLabel;
56   ModuleBase_DoubleSpinBox* mySpinBox;
57 };
58
59 #endif