Salome HOME
Merge branch 'Dev_0.7.1' of newgeom:newgeom.git into Dev_0.7.1
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetLabel.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModuleBase_WidgetLabel.h
4 // Created:     03 Dec 2014
5 // Author:      Vitaly SMETANNIKOV
6
7 #ifndef ModuleBase_WidgetLabel_H
8 #define ModuleBase_WidgetLabel_H
9
10 #include "ModuleBase.h"
11 #include "ModuleBase_ModelWidget.h"
12
13 class QLabel;
14
15 /**
16 * Implementation of model widget for a label control
17 */
18 class MODULEBASE_EXPORT ModuleBase_WidgetLabel : public ModuleBase_ModelWidget
19 {
20 Q_OBJECT
21  public:
22   /// Constructor
23   /// \param theParent the parent object
24   /// \param theData the widget configuation. The attribute of the model widget is obtained from
25   /// \param theParentId is Id of a parent of the current attribute
26   ModuleBase_WidgetLabel(QWidget* theParent, const Config_WidgetAPI* theData,
27                             const std::string& theParentId);
28
29   virtual ~ModuleBase_WidgetLabel();
30
31   /// Defines if it is supported to set the value in this widget
32   /// It returns false because this is an info widget
33   virtual bool canSetValue() const { return false; };
34
35   virtual bool storeValue() const
36   {
37     return true;
38   }
39
40   virtual bool restoreValue()
41   {
42     return true;
43   }
44
45   virtual QList<QWidget*> getControls() const;
46
47   QWidget* getControl() const;
48
49   /// This control doesn't accept focus
50   virtual bool focusTo() { return false; }
51
52 private:
53   /// A label control
54   QLabel* myLabel;
55 };
56
57 #endif