1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModuleBase_LabelValue.h
4 // Created: 30 Nov 2016
5 // Author: Natalia ERMOLAEVA
7 #ifndef ModuleBase_LabelValue_H
8 #define ModuleBase_LabelValue_H
10 #include "ModuleBase.h"
18 * Implementation of model widget for a label control
20 class MODULEBASE_EXPORT ModuleBase_LabelValue : public QWidget
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 int thePrecision = -12);
34 virtual ~ModuleBase_LabelValue();
36 /// Fills the label value with the given value
37 /// \param theValue a value
38 void setValue(const double theValue);
40 /// Returns double value
42 double value() const { return myValue; }
45 QLabel* myLabel; ///< A label information control
46 QLabel* myLabelValue; ///< A label value control
48 double myValue; ///< A cashed value to avoid a string conversion
49 int myPrecision; ///< Precision value