2 #ifndef XGUI_DocumentDataModel_H
3 #define XGUI_DocumentDataModel_H
5 #include <QAbstractItemModel>
6 #include <Event_Listener.h>
10 class ModelAPI_Document;
11 class XGUI_PartDataModel;
12 class XGUI_TopDataModel;
15 class XGUI_DocumentDataModel : public QAbstractItemModel, public Event_Listener
19 XGUI_DocumentDataModel(QObject* theParent);
20 virtual ~XGUI_DocumentDataModel();
22 // Event Listener method
23 virtual void processEvent(const Event_Message* theMessage);
26 virtual QVariant data(const QModelIndex& theIndex, int theRole) const;
27 virtual QVariant headerData(int theSection, Qt::Orientation theOrient,
28 int theRole = Qt::DisplayRole) const;
30 virtual int rowCount(const QModelIndex& theParent = QModelIndex()) const;
31 virtual int columnCount(const QModelIndex& theParent = QModelIndex()) const;
33 virtual QModelIndex index(int theRow, int theColumn,
34 const QModelIndex &parent = QModelIndex()) const;
36 virtual QModelIndex parent(const QModelIndex& theIndex) const;
38 virtual bool hasChildren(const QModelIndex& theParent = QModelIndex()) const;
42 QModelIndex toSourceModel(const QModelIndex& theProxy) const;
43 QModelIndex fromSourceModel(const QModelIndex& theSource) const;
46 std::shared_ptr<ModelAPI_Document> myDocument;
48 XGUI_TopDataModel* myModel;
49 QList<XGUI_PartDataModel*> myPartModels;