Salome HOME
Clean Property panel before starting of a new operation.
[modules/shaper.git] / src / XGUI / XGUI_PropertyPanel.h
1 /*
2  * XGUI_PropertyPanel.h
3  *
4  *  Created on: Apr 29, 2014
5  *      Author: sbh
6  */
7
8 #ifndef XGUI_PROPERTYPANEL_H_
9 #define XGUI_PROPERTYPANEL_H_
10
11 #include "XGUI.h"
12
13 #include <ModuleBase_ModelWidget.h>
14
15 #include <QDockWidget>
16 #include <QList>
17
18 class QKeyEvent;
19 class QVBoxLayout;
20
21 class XGUI_EXPORT XGUI_PropertyPanel: public QDockWidget
22 {
23   Q_OBJECT
24 public:
25   XGUI_PropertyPanel(QWidget* theParent);
26   virtual ~XGUI_PropertyPanel();
27
28   QWidget* contentWidget();
29   void setModelWidgets(const QList<ModuleBase_ModelWidget*>& theWidgets);
30
31   void cleanContent();
32
33 protected:
34   virtual bool eventFilter(QObject *theObject, QEvent *theEvent);
35
36 public slots:
37   void updateContentWidget(FeaturePtr theFeature);
38   /// slot to set the focus to the widget visualized an attribute with the given name
39   /// \param theAttributteName
40   void onFocusActivated(const std::string& theAttributeName);
41
42 signals:
43   /// The signal about key release on the control, that corresponds to the attribute
44   /// \param theAttributeName a name of the attribute
45   /// \param theEvent key release event
46   void keyReleased(const std::string& theAttributeName, QKeyEvent* theEvent);
47
48 private:
49   QWidget* myCustomWidget;
50
51   QList<ModuleBase_ModelWidget*> myWidgets;
52
53   QVBoxLayout* myMainLayout;
54 };
55
56 #endif /* XGUI_PROPERTYPANEL_H_ */