]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_PropertyPanel.h
Salome HOME
refs #80 - Sketch base GUI: create/draw point, circle and arc
[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   const QList<ModuleBase_ModelWidget*>& modelWidgets() const;
31
32   void cleanContent();
33
34 protected:
35   virtual bool eventFilter(QObject *theObject, QEvent *theEvent);
36
37 public slots:
38   void updateContentWidget(FeaturePtr theFeature);
39   /// slot to set the focus to the widget visualized an attribute with the given name
40   /// \param theAttributteName
41   void onFocusActivated(const std::string& theAttributeName);
42   /// slot to activate the next widget in the property panel
43   /// \param theWidget a widget. The next widget should be activated
44   void onActivateNextWidget(ModuleBase_ModelWidget* theWidget);
45
46 signals:
47   /// The signal about key release on the control, that corresponds to the attribute
48   /// \param theAttributeName a name of the attribute
49   /// \param theEvent key release event
50   void keyReleased(const std::string& theAttributeName, QKeyEvent* theEvent);
51   /// The signal about the widget activation
52   /// \param theWidget the activated widget
53   void widgetActivated(ModuleBase_ModelWidget* theWidget);
54
55   /// Signal about the point 2d set to the feature
56   /// \param the feature
57   /// \param the attribute of the feature
58   void storedPoint2D(FeaturePtr theFeature, const std::string& theAttribute);
59
60 protected:
61   /// Activate the widget, which means the focus on the widget.
62   /// The signal about the widget activation is emitted
63   /// \param theWidget
64   void activateWidget(ModuleBase_ModelWidget* theWidget);
65
66 private:
67   QWidget* myCustomWidget;
68
69   QList<ModuleBase_ModelWidget*> myWidgets;
70
71   QVBoxLayout* myMainLayout;
72 };
73
74 #endif /* XGUI_PROPERTYPANEL_H_ */