X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetFeature.h;h=ec74136542e54c80890f2274e86c4d5d3f7a8f30;hb=9585dccdd4d56657ced8ef9b25797979ea237f76;hp=fbfc7e2e9a9a620a128dc7f69f81b6f232a20558;hpb=871d21cd6e0ab86c79867145cb90a7e9dd7cd830;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetFeature.h b/src/ModuleBase/ModuleBase_WidgetFeature.h index fbfc7e2e9..ec7413654 100644 --- a/src/ModuleBase/ModuleBase_WidgetFeature.h +++ b/src/ModuleBase/ModuleBase_WidgetFeature.h @@ -16,6 +16,7 @@ class ModelAPI_Feature; class QWidget; class QLabel; class QLineEdit; +class QToolButton; /**\class ModuleBase_WidgetFeature * \ingroup GUI @@ -23,13 +24,14 @@ class QLineEdit; */ class MODULEBASE_EXPORT ModuleBase_WidgetFeature : public ModuleBase_ModelWidget { - 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_WidgetFeature(QWidget* theParent, const Config_WidgetAPI* theData, const std::string& theParentId); + ModuleBase_WidgetFeature(QWidget* theParent, const Config_WidgetAPI* theData, + const std::string& theParentId); /// Destructor virtual ~ModuleBase_WidgetFeature(); @@ -40,9 +42,9 @@ public: /// Saves the internal parameters to the given feature /// \param theFeature a model feature to be changed - virtual bool storeValue(ObjectPtr theObject) const; + virtual bool storeValue() const; - virtual bool restoreValue(ObjectPtr theObject); + virtual bool restoreValue(); /// Returns the internal parent wiget control, that can be shown anywhere /// \returns the widget @@ -51,32 +53,44 @@ public: /// Returns list of widget controls /// \return a control list virtual QList getControls() const; + /// Defines if it is supposed that the widget should interact with the viewer. + virtual bool isViewerSelector() { return true; } -protected: + protected: /// Fill the widget values by given point /// \param thePoint the point /// \return the boolean result of the feature set - bool setObject(const ObjectPtr& theObject); + bool setObject(const ObjectPtr& theObject, bool theSendEvent = true); /// Returns current widget feature /// \return the feature - const ObjectPtr object() const { return myObject; } + const ObjectPtr object() const + { + return myObject; + } /// Returns the widget editor /// \return the editor - QLineEdit* editor() const { return myEditor; } + QLineEdit* editor() const + { + return myEditor; + } /// Returns the possible feature kinds /// \return the list of kinds - const QStringList& featureKinds() const { return myObjectKinds; } - -private: - ObjectPtr myObject; ///< the current widget feature - QStringList myObjectKinds; ///< the kinds of possible features - - QWidget* myContainer; /// the parent top control - QLabel* myLabel; /// the editor information label - QLineEdit* myEditor; ///< the feature editor to visualize the feature name + const QStringList& featureKinds() const + { + return myObjectKinds; + } + + protected: + ObjectPtr myObject; ///< the current widget feature + QStringList myObjectKinds; ///< the kinds of possible features + + private: + QWidget* myContainer; /// the parent top control + QLabel* myLabel; /// the editor information label + QLineEdit* myEditor; ///< the feature editor to visualize the feature name }; #endif