Salome HOME
1. Correction for perfomance problem by Apply button state update: do not listen...
[modules/shaper.git] / src / SamplePanelPlugin / SamplePanelPlugin_ModelWidget.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        SamplePanelPlugin_PageGroupBox.h
4 // Created:     29 Mar 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef SamplePanelPlugin_ModelWidget_H_
8 #define SamplePanelPlugin_ModelWidget_H_
9
10 #include <ModuleBase_ModelWidget.h>
11
12 #include <ModelAPI_Feature.h>
13
14 class Config_WidgetAPI;
15
16 class QWidget;
17 class QComboBox;
18
19 /*!
20  * \ingroup GUI
21  * Represent a content of the property panel to show/modify parameters of some feature.
22  */
23 class SamplePanelPlugin_ModelWidget : public ModuleBase_ModelWidget
24 {
25  Q_OBJECT
26 public:
27   /// Constructs a model widget
28   SamplePanelPlugin_ModelWidget(QWidget* theParent, const Config_WidgetAPI* theData);
29   /// Destructs the model widget
30   virtual ~SamplePanelPlugin_ModelWidget() {}
31
32   /// Returns list of widget controls
33   /// \return a control list
34   virtual QList<QWidget*> getControls() const;
35
36 protected:
37   /// Saves the internal parameters to the given feature
38   /// \return True in success
39   virtual bool storeValueCustom();
40
41   /// Restore value from attribute data to the widget's control
42   virtual bool restoreValueCustom();
43
44 private:
45   QWidget* myMainWidget; // parent control for all widget controls
46   QComboBox* myComboBox; // control for value attribute of the current feature
47   int myDefaultValue; /// the default combo box value
48 };
49
50 #endif /* SamplePanelPlugin_ModelWidget_H_ */