1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: ModuleBase_WidgetCheckGroupBox.h
4 // Created: 13 Dec 2015
5 // Author: Natalia ERMOLAEVA
7 #ifndef ModuleBase_WidgetCheckGroupBox_H_
8 #define ModuleBase_WidgetCheckGroupBox_H_
10 #include <ModuleBase.h>
11 #include <ModuleBase_PageBase.h>
12 #include <ModuleBase_ModelWidget.h>
19 * Implements a model widget for switch as a container widget. It can be defined in XML with "toolbox" keyword
21 class MODULEBASE_EXPORT ModuleBase_WidgetCheckGroupBox : public ModuleBase_ModelWidget,
22 public ModuleBase_PageBase
27 /// \param theParent the parent object
28 /// \param theData the widget configuration. The attribute of the model widget is obtained from
29 ModuleBase_WidgetCheckGroupBox(QWidget* theParent, const Config_WidgetAPI* theData);
30 virtual ~ModuleBase_WidgetCheckGroupBox();
32 /// Defines if it is supported to set the value in this widget
33 /// \return false because this is an info widget
34 virtual bool canAcceptFocus() const { return false; };
36 /// Set the title of the group box
37 /// \param theTitle the text of the title
38 void setTitle(const QString& theTitle);
40 /// Methods to be redefined from ModuleBase_PageBase: start
41 /// Cast the page to regular QWidget
42 virtual QWidget* pageWidget();
43 /// Methods to be redefined from ModuleBase_PageBase: end
45 /// Methods to be redefined from ModuleBase_ModelWidget: start
46 /// Returns list of widget controls
47 /// \return a control list
48 virtual QList<QWidget*> getControls() const;
49 /// Methods to be redefined from ModuleBase_ModelWidget: end
52 // store value to the model
56 /// Methods to be redefined from ModuleBase_PageBase: start
57 /// Adds the given widget to page's layout
58 virtual void placeModelWidget(ModuleBase_ModelWidget* theWidget);
59 /// Adds the given page to page's layout
60 virtual void placeWidget(QWidget* theWidget);
61 /// Returns page's layout (QGridLayout)
62 virtual QLayout* pageLayout();
63 /// Adds a stretch to page's layout
64 virtual void addPageStretch();
65 /// Methods to be redefined from ModuleBase_PageBase: end
68 /// Methods to be redefined from ModuleBase_ModelWidget: start
69 /// Saves the internal parameters to the given feature
70 /// \return True in success
71 virtual bool storeValueCustom();
72 /// Restore value from attribute data to the widget's control
73 virtual bool restoreValueCustom();
74 /// Methods to be redefined from ModuleBase_ModelWidget: end
77 QGroupBox* myGroupBox;
78 QGridLayout* myMainLayout; ///< page's layout
81 #endif /* ModuleBase_WidgetCheckGroupBox_H_ */