Salome HOME
1. Correction for perfomance problem by Apply button state update: do not listen...
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetCheckGroupBox.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        ModuleBase_WidgetCheckGroupBox.h
4 // Created:     13 Dec 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef ModuleBase_WidgetCheckGroupBox_H_
8 #define ModuleBase_WidgetCheckGroupBox_H_
9
10 #include <ModuleBase.h>
11 #include <ModuleBase_PageBase.h>
12 #include <ModuleBase_ModelWidget.h>
13
14 class QGroupBox;
15 class QGridLayout;
16
17 /**
18 * \ingroup GUI
19 * Implements a model widget for switch as a container widget. It can be defined in XML with "toolbox" keyword
20 */
21 class MODULEBASE_EXPORT ModuleBase_WidgetCheckGroupBox : public ModuleBase_ModelWidget,
22                                                          public ModuleBase_PageBase
23 {
24   Q_OBJECT
25 public:
26   /// Constructor
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();
31
32   void setTitle(const QString& theTitle);
33
34   /// Methods to be redefined from ModuleBase_PageBase: start
35   /// Cast the page to regular QWidget
36   virtual QWidget* pageWidget();
37   /// Methods to be redefined from ModuleBase_PageBase: end
38
39   /// Methods to be redefined from ModuleBase_ModelWidget: start
40   /// Returns list of widget controls
41   /// \return a control list
42   virtual QList<QWidget*> getControls() const;
43   /// Methods to be redefined from ModuleBase_ModelWidget: end
44
45 protected slots:
46   // store value to the model
47   void onPageClicked();
48
49 protected:
50   /// Methods to be redefined from ModuleBase_PageBase: start
51   /// Adds the given widget to page's layout
52   virtual void placeModelWidget(ModuleBase_ModelWidget* theWidget);
53   /// Adds the given page to page's layout
54   virtual void placeWidget(QWidget* theWidget);
55   /// Returns page's layout (QGridLayout)
56   virtual QLayout* pageLayout();
57   /// Adds a stretch to page's layout
58   virtual void addPageStretch();
59   /// Methods to be redefined from ModuleBase_PageBase: end
60
61
62   /// Methods to be redefined from ModuleBase_ModelWidget: start
63   /// Saves the internal parameters to the given feature
64   /// \return True in success
65   virtual bool storeValueCustom();
66   /// Restore value from attribute data to the widget's control
67   virtual bool restoreValueCustom();
68   /// Methods to be redefined from ModuleBase_ModelWidget: end
69
70 private:
71   QGroupBox* myGroupBox;
72   QGridLayout* myMainLayout; ///< page's layout
73 };
74
75 #endif /* ModuleBase_WidgetCheckGroupBox_H_ */