X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetEditor.h;h=508e5ee53871ca5d9b1144deffe3dbd73e62c779;hb=6538b6539abf93cf24183c7cfe8a5800a464178f;hp=ec670f402cb9deb3e50bb7ad51b29b024f4db1fc;hpb=153ebe12a5be239150a66e8ccc1489638bf0ca6d;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetEditor.h b/src/ModuleBase/ModuleBase_WidgetEditor.h index ec670f402..508e5ee53 100644 --- a/src/ModuleBase/ModuleBase_WidgetEditor.h +++ b/src/ModuleBase/ModuleBase_WidgetEditor.h @@ -6,7 +6,7 @@ #define ModuleBase_WidgetEditor_H #include -#include "ModuleBase_ModelWidget.h" +#include "ModuleBase_WidgetDoubleValue.h" #include #include @@ -18,40 +18,38 @@ class QLineEdit; * \ingroup GUI * \brief Custom widget. An abstract class to be redefined to fill with some GUI controls */ -class MODULEBASE_EXPORT ModuleBase_WidgetEditor : public ModuleBase_ModelWidget +class MODULEBASE_EXPORT ModuleBase_WidgetEditor : public ModuleBase_WidgetDoubleValue { - Q_OBJECT -public: +Q_OBJECT + public: /// Constructor /// \theParent the parent object /// \theParent the parent object /// \theData the widget configuation. The attribute of the model widget is obtained from - ModuleBase_WidgetEditor(QWidget* theParent, const Config_WidgetAPI* theData); + ModuleBase_WidgetEditor(QWidget* theParent, const Config_WidgetAPI* theData, + const std::string& theParentId); + /// Constructor + /// \theParent the parent object + /// \theParent the parent object + /// \theData the widget configuation. The attribute of the model widget is obtained from + ModuleBase_WidgetEditor(QWidget* theParent, const std::string& theAttribute); + /// Destructor virtual ~ModuleBase_WidgetEditor(); - /// Saves the internal parameters to the given feature - /// \param theFeature a model feature to be changed - virtual bool storeValue(FeaturePtr theFeature) const; - - virtual bool restoreValue(FeaturePtr theFeature); - /// Set focus to the first control of the current widget. The focus policy of the control is checked. /// If the widget has the NonFocus focus policy, it is skipped. - virtual void focusTo(); - - /// Returns the internal parent wiget control, that can be shown anywhere - /// \returns the widget - QWidget* getControl() const; + /// \return the state whether the widget can accept the focus + virtual bool focusTo(); - /// Returns list of widget controls - /// \return a control list - virtual QList getControls() const; + /// Creates an editor for the real value and set the new value to the feature + /// \param theFeature the model feature + /// \param theAttribute the feature attribute + static void editFeatureValue(FeaturePtr theFeature, const std::string theAttribute); -private: - FeaturePtr myFeature; ///< the current widget feature - QStringList myFeatureKinds; ///< the kinds of possible features - double myValue; + private: + FeaturePtr myFeature; ///< the current widget feature + QStringList myFeatureKinds; ///< the kinds of possible features }; #endif