Salome HOME
Useful methods for sketch operations managements
[modules/shaper.git] / src / XGUI / XGUI_ObjectsBrowser.h
1
2 #ifndef XGUI_ObjectsBrowser_H
3 #define XGUI_ObjectsBrowser_H
4
5 #include "XGUI.h"
6 #include "XGUI_Constants.h"
7
8 #include <QTreeView>
9
10 class XGUI_DocumentDataModel;
11
12 /**\class XGUI_ObjectsBrowser
13  * \ingroup GUI
14  * \brief Object browser window object. Represents data tree of current data structure
15  */
16  class XGUI_EXPORT XGUI_ObjectsBrowser : public QTreeView
17 {
18   Q_OBJECT
19 public:
20   XGUI_ObjectsBrowser(QWidget* theParent);
21   virtual ~XGUI_ObjectsBrowser();
22
23   //! Returns Model which provides access to data objects
24   XGUI_DocumentDataModel* dataModel() const { return myDocModel; }
25
26   //! Returns list of currently selected features
27   QFeatureList selectedFeatures() const { return mySelectedData; }
28
29 signals:
30   //! Emited when selection is changed
31   void selectionChanged();
32   void activePartChanged(FeaturePtr thePart); 
33
34 protected:
35   virtual void mouseDoubleClickEvent(QMouseEvent* theEvent);
36
37 private slots:
38   //! Called when selection in Data Tree is changed
39   void onSelectionChanged(const QItemSelection& theSelected, const QItemSelection& theDeselected);
40
41 private:
42   //! Internal model
43   XGUI_DocumentDataModel* myDocModel;
44
45   //! List of currently selected data
46   QFeatureList mySelectedData;
47
48   //QModelIndex myActivePartIndex;
49 };
50
51 #endif