20 #ifndef XGUI_DataModel_H
21 #define XGUI_DataModel_H
24 #include <ModuleBase_Definitions.h>
25 #include <ModelAPI_Object.h>
26 #include <ModelAPI_Document.h>
27 #include <Events_Listener.h>
29 #include <QAbstractItemModel>
63 virtual void processEvent(
const std::shared_ptr<Events_Message>& theMessage);
67 virtual ObjectPtr
object(
const QModelIndex& theIndex)
const;
71 virtual QModelIndex objectIndex(
const ObjectPtr theObject,
int theColumn = 1)
const;
77 virtual void rebuildDataTree();
82 virtual QVariant data(
const QModelIndex& theIndex,
int theRole)
const;
88 virtual QVariant headerData(
int theSection, Qt::Orientation theOrient,
int theRole =
89 Qt::DisplayRole)
const;
94 virtual int rowCount(
const QModelIndex& theParent = QModelIndex())
const;
99 virtual int columnCount(
const QModelIndex& theParent = QModelIndex())
const;
106 virtual QModelIndex index(
int theRow,
int theColumn,
const QModelIndex &theParent =
107 QModelIndex())
const;
112 virtual QModelIndex parent(
const QModelIndex& theIndex)
const;
116 virtual bool hasChildren(
const QModelIndex& theParent = QModelIndex())
const;
123 virtual bool insertRows(
int theRow,
int theCount,
const QModelIndex& theParent = QModelIndex());
129 virtual bool removeRows(
int theRow,
int theCount,
const QModelIndex& theParent = QModelIndex());
133 virtual Qt::ItemFlags flags(
const QModelIndex& theIndex)
const;
136 virtual bool canDropMimeData(
const QMimeData *theData, Qt::DropAction theAction,
137 int theRow,
int theColumn,
const QModelIndex &theParent)
const override;
140 virtual QMimeData* mimeData(
const QModelIndexList &indexes)
const override;
143 virtual bool dropMimeData(
const QMimeData *theData, Qt::DropAction theAction,
144 int theRow,
int theColumn,
const QModelIndex &theParent)
override;
148 QModelIndex documentRootIndex(DocumentPtr theDoc,
int theColumn = 1)
const;
153 bool hasHiddenState(
const QModelIndex& theIndex);
157 bool hasIndex(
const QModelIndex& theIndex)
const;
165 DocumentPtr document(
const QModelIndex& theIndex)
const;
175 return Qt::MoveAction;
186 enum VisibilityState {
198 QMap<DocumentPtr, QStringList> myShownFolders;
Base interface for any event listener.
Definition: Events_Listener.h:37
virtual EVENTS_EXPORT void processEvent(const std::shared_ptr< Events_Message > &theMessage)=0
This method is called by loop when the event is started to process.
Definition: ModuleBase_ITreeNode.h:44
This is a data model for Object Browser (QTreeView).
Definition: XGUI_DataModel.h:46
void beforeTreeRebuild()
Signal send before tree rebuild.
virtual Qt::DropActions supportedDropActions() const override
Allows to support drag and drop of some model items.
Definition: XGUI_DataModel.h:173
void treeRebuilt()
Signal about tree had been rebuilt.
Class which defines a configuration of the application (Workshop) and launches it.
Definition: XGUI_Workshop.h:83