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"
19 * Implementation of model widget for choice widget definition (combo box)
20 * It can be defined as following:
22 * <choice id="bool_type"
24 * tooltip="Type of boolean operation"
25 * string_list="Cut Fuse Common"
29 class MODULEBASE_EXPORT ModuleBase_WidgetChoice : public ModuleBase_ModelWidget
34 /// \param theParent the parent object
35 /// \param theData the widget configuation. The attribute of the model widget is obtained from
36 /// \param theParentId is Id of a parent of the current attribute
37 ModuleBase_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData,
38 const std::string& theParentId);
40 virtual ~ModuleBase_WidgetChoice();
42 virtual bool restoreValue();
44 virtual bool focusTo();
46 /// Returns the internal parent wiget control, that can be shown anywhere
47 /// \returns the widget
48 QWidget* getControl() const
53 /// Returns list of widget controls
54 /// \return a controls list
55 virtual QList<QWidget*> getControls() const;
58 /// Saves the internal parameters to the given feature
59 /// \return True in success
60 virtual bool storeValueCustom() const;
63 /// Slot called on combo box index change
64 void onCurrentIndexChanged(int theIndex);