class ModuleBase_IDocumentDataModel;
class QLineEdit;
+class XGUI_DataModel;
+
+//#define ModuleDataModel
/**
* \ingroup GUI
/// Commit modified data (used for renaming of objects)
virtual void commitData(QWidget* theEditor);
+ void onDoubleClick(const QModelIndex&);
+
protected:
/// Redefinition of virtual method
virtual void contextMenuEvent(QContextMenuEvent* theEvent);
virtual ~XGUI_ObjectsBrowser();
//! Returns Model which provides access to data objects
+#ifdef ModuleDataModel
ModuleBase_IDocumentDataModel* dataModel() const
{
return myDocModel;
}
-
- //! Returns list of currently selected objects
- QObjectPtrList selectedObjects() const
+#else
+ XGUI_DataModel* dataModel() const
{
- return mySelectedData;
+ return myDocModel;
}
+#endif
+
+ //! Returns list of currently selected objects
+ //! \param theIndexes - output list of corresponded indexes (can be NULL)
+ QObjectPtrList selectedObjects(QModelIndexList* theIndexes = 0) const;
/// Set selected list of objects
/// \param theObjects list of objects to select
void clearContent();
/// Set Data Model for the Object Browser
+#ifdef ModuleDataModel
void setDataModel(ModuleBase_IDocumentDataModel* theModel);
+#endif
+
+public slots:
+ //! Called on Edit command request
+ void onEditItem();
signals:
//! Emited when selection is changed
//! Emited on context menu request
void contextMenuRequested(QContextMenuEvent* theEvent);
+ //! Segnal is emitted when user cliks by mouse in header label of object browser
+ void headerMouseDblClicked(const QModelIndex&);
+
protected:
/// Redefinition of virtual method
virtual bool eventFilter(QObject* obj, QEvent* theEvent);
/// \param thePnt a position of context menu
void onLabelContextMenuRequested(const QPoint& thePnt);
- //! Called on Edit command request
- void onEditItem();
-
//! Called when selection in Data Tree is changed
void onSelectionChanged(const QItemSelection& theSelected, const QItemSelection& theDeselected);
void closeDocNameEditing(bool toSave);
//! Internal model
+#ifdef ModuleDataModel
ModuleBase_IDocumentDataModel* myDocModel;
-
+#else
+ XGUI_DataModel* myDocModel;
+#endif
QLineEdit* myActiveDocLbl;
XGUI_DataTree* myTreeView;
-
- QObjectPtrList mySelectedData;
};
#endif