Salome HOME
Issue #805 In the sketch presentation, show both the parameter and its value: minor...
[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 * \ingroup GUI
17 * Implementation of model widget for a label control
18 */
19 class MODULEBASE_EXPORT ModuleBase_WidgetLabel : public ModuleBase_ModelWidget
20 {
21 Q_OBJECT
22  public:
23   /// Constructor
24   /// \param theParent the parent object
25   /// \param theData the widget configuation. The attribute of the model widget is obtained from
26   ModuleBase_WidgetLabel(QWidget* theParent, const Config_WidgetAPI* theData);
27
28   virtual ~ModuleBase_WidgetLabel();
29
30   /// Defines if it is supported to set the value in this widget
31   /// It returns false because this is an info widget
32   virtual bool canAcceptFocus() const { return false; };
33
34   virtual bool restoreValueCustom()
35   {
36     return true;
37   }
38
39   virtual QList<QWidget*> getControls() const;
40
41   /// This control doesn't accept focus
42   virtual bool focusTo() { return false; }
43
44 protected:
45   /// Saves the internal parameters to the given feature
46   /// \return True in success
47   virtual bool storeValueCustom() const
48   {
49     return true;
50   }
51
52   /// A label control
53   QLabel* myLabel;
54 };
55
56 #endif