1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModuleBase_WidgetChoice.h
4 // Created: 03 Sept 2014
5 // Author: Vitaly Smetannikov
7 #ifndef ModuleBase_WidgetChoice_H
8 #define ModuleBase_WidgetChoice_H
10 #include "ModuleBase.h"
11 #include "ModuleBase_ModelWidget.h"
20 * Implementation of model widget for choice widget definition (combo box)
21 * It can be defined as following:
23 * <choice id="bool_type"
25 * tooltip="Type of boolean operation"
26 * string_list="Cut Fuse Common"
29 * Aditionally can be used:
30 * A key "widget_type". It can have values "combobox" or "radiobuttons".
31 * By default it uses "combobox".
32 * A key "buttons_dir" which is applicable only for "radiobuttons" mode.
33 * It defines direction of radiobuttons layout. it can be "vertical" or "horizontal"
34 * Default value is "vertical"
36 class MODULEBASE_EXPORT ModuleBase_WidgetChoice : public ModuleBase_ModelWidget
41 /// \param theParent the parent object
42 /// \param theData the widget configuation. The attribute of the model widget is obtained from
43 /// \param theParentId is Id of a parent of the current attribute
44 ModuleBase_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData,
45 const std::string& theParentId);
47 virtual ~ModuleBase_WidgetChoice();
49 virtual bool focusTo();
51 /// Returns list of widget controls
52 /// \return a controls list
53 virtual QList<QWidget*> getControls() const;
56 /// Saves the internal parameters to the given feature
57 /// \return True in success
58 virtual bool storeValueCustom() const;
60 virtual bool restoreValueCustom();
63 /// Slot called on combo box index change
64 void onCurrentIndexChanged(int theIndex);
72 QButtonGroup* myButtons;