X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetChoice.h;h=e8db6c289487d6942d47c8688fadc26c282b7e34;hb=8cd56d486b6e96b8814002f9f0f4acadd6cea11b;hp=412821d2c475ef3865f089b2bda411f99a93cfb5;hpb=a24b7e6f4d112d5e7889fd76f030298fc428cd01;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetChoice.h b/src/ModuleBase/ModuleBase_WidgetChoice.h index 412821d2c..e8db6c289 100644 --- a/src/ModuleBase/ModuleBase_WidgetChoice.h +++ b/src/ModuleBase/ModuleBase_WidgetChoice.h @@ -13,6 +13,7 @@ class QWidget; class QLabel; class QComboBox; +class QButtonGroup; /** * \ingroup GUI @@ -25,6 +26,12 @@ class QComboBox; * string_list="Cut Fuse Common" * /> * \endcode +* Aditionally can be used: +* A key "widget_type". It can have values "combobox" or "radiobuttons". +* By default it uses "combobox". +* A key "buttons_dir" which is applicable only for "radiobuttons" mode. +* It defines direction of radiobuttons layout. it can be "vertical" or "horizontal" +* Default value is "vertical" */ class MODULEBASE_EXPORT ModuleBase_WidgetChoice : public ModuleBase_ModelWidget { @@ -38,8 +45,10 @@ Q_OBJECT const std::string& theParentId); virtual ~ModuleBase_WidgetChoice(); - - virtual bool restoreValue(); + + /// Defines if it is supported to set the value in this widget + /// It returns false because this is an info widget + virtual bool canSetValue() const { return false; }; virtual bool focusTo(); @@ -47,11 +56,16 @@ Q_OBJECT /// \return a controls list virtual QList getControls() const; +signals: + void itemSelected(int); + protected: /// Saves the internal parameters to the given feature /// \return True in success virtual bool storeValueCustom() const; + virtual bool restoreValueCustom(); + private slots: /// Slot called on combo box index change void onCurrentIndexChanged(int theIndex); @@ -62,6 +76,7 @@ private: /// The control QComboBox* myCombo; + QButtonGroup* myButtons; }; #endif