Salome HOME
Fix suite_FEATURE_REVOLUTION tests: difference in few pixels
[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   /// \param theParentId is Id of a parent of the current attribute
30   ModuleBase_WidgetCheckGroupBox(QWidget* theParent, const Config_WidgetAPI* theData,
31                                  const std::string& theParentId);
32   virtual ~ModuleBase_WidgetCheckGroupBox();
33
34   void setTitle(const QString& theTitle);
35
36   /// Methods to be redefined from ModuleBase_PageBase: start
37   /// Cast the page to regular QWidget
38   virtual QWidget* pageWidget();
39   /// Methods to be redefined from ModuleBase_PageBase: end
40
41   /// Methods to be redefined from ModuleBase_ModelWidget: start
42   /// Returns list of widget controls
43   /// \return a control list
44   virtual QList<QWidget*> getControls() const;
45   /// Methods to be redefined from ModuleBase_ModelWidget: end
46
47 protected slots:
48   // store value to the model
49   void onPageClicked();
50
51 protected:
52   /// Methods to be redefined from ModuleBase_PageBase: start
53   /// Adds the given widget to page's layout
54   virtual void placeModelWidget(ModuleBase_ModelWidget* theWidget);
55   /// Adds the given page to page's layout
56   virtual void placePageWidget(ModuleBase_PageBase* theWidget);
57   /// Returns page's layout (QGridLayout)
58   virtual QLayout* pageLayout();
59   /// Adds a stretch to page's layout
60   virtual void addPageStretch();
61   /// Methods to be redefined from ModuleBase_PageBase: end
62
63
64   /// Methods to be redefined from ModuleBase_ModelWidget: start
65   /// Saves the internal parameters to the given feature
66   /// \return True in success
67   virtual bool storeValueCustom() const;
68   /// Restore value from attribute data to the widget's control
69   virtual bool restoreValueCustom();
70   /// Methods to be redefined from ModuleBase_ModelWidget: end
71
72 private:
73   QGroupBox* myGroupBox;
74   QGridLayout* myMainLayout; ///< page's layout
75 };
76
77 #endif /* ModuleBase_WidgetCheckGroupBox_H_ */