1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModuleBase_WidgetIntValue.h
4 // Created: 04 June 2014
5 // Author: Vitaly Smetannikov
7 #ifndef ModuleBase_WidgetIntValue_H
8 #define ModuleBase_WidgetIntValue_H
10 #include "ModuleBase.h"
11 #include "ModuleBase_ModelWidget.h"
13 class ModuleBase_ParamIntSpinBox;
14 class Config_WidgetAPI;
21 * A class of property panel widget for integer value input
22 * It can be defined with "integervalue" keyword. For example:
24 * <integervalue id="x" label="X:" icon=":pictures/x_point.png" tooltip="X coordinate"/>
27 class MODULEBASE_EXPORT ModuleBase_WidgetIntValue : public ModuleBase_ModelWidget
32 /// \param theParent the parent object
33 /// \param theData the widget configuration. The attribute of the model widget is obtained from
34 /// \param theParentId is Id of a parent structure (widget, operation, group)
35 ModuleBase_WidgetIntValue(QWidget* theParent, const Config_WidgetAPI* theData,
36 const std::string& theParentId);
38 virtual ~ModuleBase_WidgetIntValue();
40 /// Select the internal content if it can be selected. It is empty in the default realization
41 virtual void selectContent();
43 /// Returns list of widget controls
44 /// \return a control list
45 virtual QList<QWidget*> getControls() const;
47 /// Returns true if the event is processed.
48 virtual bool processEnter();
51 /// Saves the internal parameters to the given feature
52 /// \return True in success
53 virtual bool storeValueCustom() const;
55 //! Read value of corresponded attribute from data model to the input control
56 // \return True in success
57 virtual bool restoreValueCustom();
59 /// Fills the widget with default values
60 /// \return true if the widget current value is reset
61 virtual bool resetCustom();
64 /// Label of the widget
67 /// Input value control
68 ModuleBase_ParamIntSpinBox* mySpinBox;