2 #ifndef XGUI_ObjectsBrowser_H
3 #define XGUI_ObjectsBrowser_H
6 #include "XGUI_Constants.h"
11 class XGUI_DocumentDataModel;
15 class XGUI_DataTree: public QTreeView
19 XGUI_DataTree(QWidget* theParent);
20 virtual ~XGUI_DataTree();
22 //! Returns list of currently selected features
23 QFeatureList selectedFeatures() const { return mySelectedData; }
25 XGUI_DocumentDataModel* dataModel() const;
28 //! Emited when selection is changed
29 void selectionChanged();
30 void activePartChanged(FeaturePtr thePart);
32 //! Emited on context menu request
33 void contextMenuRequested(QContextMenuEvent* theEvent);
36 virtual void mouseDoubleClickEvent(QMouseEvent* theEvent);
37 virtual void contextMenuEvent(QContextMenuEvent* theEvent);
40 //! Called when selection in Data Tree is changed
41 void onSelectionChanged(const QItemSelection& theSelected, const QItemSelection& theDeselected);
44 //! List of currently selected data
45 QFeatureList mySelectedData;
49 /**\class XGUI_ObjectsBrowser
51 * \brief Object browser window object. Represents data tree of current data structure
53 class XGUI_EXPORT XGUI_ObjectsBrowser : public QWidget
57 XGUI_ObjectsBrowser(QWidget* theParent);
58 virtual ~XGUI_ObjectsBrowser();
60 //! Returns Model which provides access to data objects
61 XGUI_DocumentDataModel* dataModel() const { return myDocModel; }
63 //! Returns list of currently selected features
64 QFeatureList selectedFeatures() const { return myTreeView->selectedFeatures(); }
66 //! Returns currently selected indexes
67 QModelIndexList selectedIndexes() const { return myTreeView->selectionModel()->selectedIndexes(); }
69 //! Returns TreeView widget
70 XGUI_DataTree* treeView() const { return myTreeView; }
72 //! Activates currently selected part. Signal activePartChanged will not be sent
73 void activateCurrentPart(bool toActivate);
76 //! Emited when selection is changed
77 void selectionChanged();
79 //! Emited when current active document is changed
80 void activePartChanged(FeaturePtr thePart);
82 //! Emited on context menu request
83 void contextMenuRequested(QContextMenuEvent* theEvent);
86 virtual bool eventFilter(QObject* obj, QEvent* theEvent);
89 void onActivePartChanged(FeaturePtr thePart);
93 XGUI_DocumentDataModel* myDocModel;
95 QLabel* myActiveDocLbl;
96 XGUI_DataTree* myTreeView;