Salome HOME
Improvement for key "Delete" processing: should be done only on possible objects...
[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   virtual QList<QWidget*> getControls() const;
37
38   /// This control doesn't accept focus
39   virtual bool focusTo();
40
41 protected:
42   /// Saves the internal parameters to the given feature
43   /// \return True in success
44   virtual bool storeValueCustom()
45   {
46     return true;
47   }
48
49   /// A label control
50   QLabel* myLabel;
51 };
52
53 #endif