class QWidget;
class QLabel;
class QComboBox;
+class QButtonGroup;
/**
+* \ingroup GUI
* Implementation of model widget for choice widget definition (combo box)
* It can be defined as following:
* \code
* 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
{
const std::string& theParentId);
virtual ~ModuleBase_WidgetChoice();
-
- virtual bool storeValue() const;
- 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();
- /// Returns the internal parent wiget control, that can be shown anywhere
- /// \returns the widget
- QWidget* getControl() const
- {
- return myContainer;
- }
-
/// Returns list of widget controls
/// \return a controls list
virtual QList<QWidget*> 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);
private:
- /// Container widget
- QWidget* myContainer;
-
/// The label
QLabel* myLabel;
/// The control
QComboBox* myCombo;
+ QButtonGroup* myButtons;
};
#endif