2 #ifndef XGUI_PartDataModel_H
3 #define XGUI_PartDataModel_H
5 #include <QAbstractItemModel>
7 class ModelAPI_Feature;
8 class ModelAPI_Document;
10 class XGUI_TopDataModel : public QAbstractItemModel
14 XGUI_TopDataModel(QObject* theParent);
15 virtual ~XGUI_TopDataModel();
17 virtual void setDocument(const std::shared_ptr<ModelAPI_Document>& theDoc)
22 // Reimplementation from QAbstractItemModel
23 virtual QVariant data(const QModelIndex& theIndex, int theRole) const;
24 virtual QVariant headerData(int section, Qt::Orientation orientation,
25 int role = Qt::DisplayRole) const;
27 virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
28 virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
30 virtual QModelIndex index(int theRow, int theColumn,
31 const QModelIndex& theParent = QModelIndex()) const;
33 virtual QModelIndex parent(const QModelIndex& theIndex) const;
35 virtual bool hasChildren(const QModelIndex& theParent = QModelIndex()) const;
45 std::shared_ptr<ModelAPI_Document> myDocument;
50 class XGUI_PartDataModel : public QAbstractItemModel
54 XGUI_PartDataModel(QObject* theParent);
55 virtual ~XGUI_PartDataModel();
57 virtual void setDocument(const std::shared_ptr<ModelAPI_Document>& theDoc, int theId)
63 // Reimplementation from QAbstractItemModel
64 virtual QVariant data(const QModelIndex& theIndex, int theRole) const;
65 virtual QVariant headerData(int section, Qt::Orientation orientation,
66 int role = Qt::DisplayRole) const;
68 virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
69 virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
71 virtual QModelIndex index(int theRow, int theColumn,
72 const QModelIndex& theParent = QModelIndex()) const;
74 virtual QModelIndex parent(const QModelIndex& theIndex) const;
76 virtual bool hasChildren(const QModelIndex& theParent = QModelIndex()) const;
87 std::shared_ptr<ModelAPI_Document> myDocument;