X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetEditor.h;h=c992e60f9c406f9aed6fcb823c9f980c05449abc;hb=247fc0bd6c6e04ce1f7a6e67f8d3c80ce17acab0;hp=657e2303a3bedf2985d010d4fab3bcf51468841c;hpb=56e28f354780915ff5c316bce7841a034599cca3;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetEditor.h b/src/ModuleBase/ModuleBase_WidgetEditor.h index 657e2303a..c992e60f9 100644 --- a/src/ModuleBase/ModuleBase_WidgetEditor.h +++ b/src/ModuleBase/ModuleBase_WidgetEditor.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: ModuleBase_WidgetEditor.h // Created: 25 Apr 2014 // Author: Natalia ERMOLAEVA @@ -6,7 +8,7 @@ #define ModuleBase_WidgetEditor_H #include -#include "ModuleBase_ModelWidget.h" +#include "ModuleBase_WidgetDoubleValue.h" #include #include @@ -18,48 +20,44 @@ 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); + /// \param theParent the parent object + /// \param theData the widget configuation. The attribute of the model widget is obtained from + /// \param theParentId is Id of a parent of the current attribute + 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 + /// \param theParent the parent object + /// \param theAttribute The attribute of the model widget 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(); + /// \return the state whether the widget can accept the focus + virtual bool focusTo(); - /// Returns the internal parent wiget control, that can be shown anywhere - /// \returns the widget - QWidget* getControl() 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); - /// Returns list of widget controls - /// \return a control list - virtual QList getControls() const; + private slots: + /// Shous popup window under cursor for data editing + void showPopupEditor(); - static void editFeatureValue(FeaturePtr theFeature, const std::string theAttribute); + private: + ///< the current widget feature + FeaturePtr myFeature; -private: - FeaturePtr myFeature; ///< the current widget feature - QStringList myFeatureKinds; ///< the kinds of possible features - double myValue; + ///< the kinds of possible features + QStringList myFeatureKinds; }; #endif