Salome HOME
Issue #1852 In the Sketcher, replace all disabled real inputs by labels
[modules/shaper.git] / src / ModuleBase / ModuleBase_LabelValue.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModuleBase_LabelValue.h
4 // Created:     30 Nov 2016
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef ModuleBase_LabelValue_H
8 #define ModuleBase_LabelValue_H
9
10 #include "ModuleBase.h"
11
12 #include <QWidget>
13
14 class QLabel;
15
16 /**
17 * \ingroup GUI
18 * Implementation of model widget for a label control
19 */
20 class MODULEBASE_EXPORT ModuleBase_LabelValue : public QWidget
21 {
22   Q_OBJECT
23 public:
24   /// Constructor
25   /// \param theParent the parent object
26   /// \param theText a text value
27   /// \param theToolTip a tool tip value
28   /// \param theIcon a icon value
29   ModuleBase_LabelValue(QWidget* theParent, const QString& theText,
30                         const QString& theToolTip = "",
31                         const QString& theIcon = "");
32
33   virtual ~ModuleBase_LabelValue();
34
35   /// Fills the label value with the given value
36   /// \param theValue a value
37   void setValue(const double theValue);
38
39   /// Returns double value
40   /// \return the value
41   double value() const { return myValue; }
42
43 protected:
44   QLabel* myLabel;  ///< A label information control
45   QLabel* myLabelValue; ///< A label value control
46
47   double myValue; ///< A cashed value to avoid a string conversion
48 };
49
50 #endif