CAD Viewer
ModelPartList.h
Go to the documentation of this file.
1 #pragma once
2 
12 #ifndef VIEWER_MODELPARTLIST_H
13 #define VIEWER_MODELPARTLIST_H
14 
15 
16 #include "ModelPart.h"
17 
18 #include <QAbstractItemModel>
19 #include <QModelIndex>
20 #include <QVariant>
21 #include <QString>
22 #include <QList>
23 
24 class ModelPart;
25 
26 class ModelPartList : public QAbstractItemModel {
27  Q_OBJECT
28 public:
34  ModelPartList(const QString& data, QObject* parent = NULL);
35 
40 
45  int columnCount(const QModelIndex& parent) const;
46 
54  QVariant data(const QModelIndex& index, int role) const;
55 
60  Qt::ItemFlags flags(const QModelIndex& index) const;
61 
62 
65  QVariant headerData(int section, Qt::Orientation orientation, int role) const;
66 
67 
76  QModelIndex index(int row, int column, const QModelIndex& parent) const;
77 
78 
83  QModelIndex parent(const QModelIndex& index) const;
84 
89  int rowCount(const QModelIndex& parent) const;
90 
95 
98  QModelIndex appendChild(QModelIndex& parent, const QList<QVariant>& data);
99 
100 
101 private:
103 };
104 #endif
Definition: ModelPartList.h:26
ModelPartList(const QString &data, QObject *parent=NULL)
Definition: ModelPartList.cpp:13
int rowCount(const QModelIndex &parent) const
Definition: ModelPartList.cpp:102
ModelPart * getRootItem()
Definition: ModelPartList.cpp:116
QModelIndex parent(const QModelIndex &index) const
Definition: ModelPartList.cpp:88
ModelPart * rootItem
Definition: ModelPartList.h:102
int columnCount(const QModelIndex &parent) const
Definition: ModelPartList.cpp:27
QModelIndex index(int row, int column, const QModelIndex &parent) const
Definition: ModelPartList.cpp:71
QVariant data(const QModelIndex &index, int role) const
Definition: ModelPartList.cpp:34
QVariant headerData(int section, Qt::Orientation orientation, int role) const
Definition: ModelPartList.cpp:63
~ModelPartList()
Definition: ModelPartList.cpp:22
Qt::ItemFlags flags(const QModelIndex &index) const
Definition: ModelPartList.cpp:55
QModelIndex appendChild(QModelIndex &parent, const QList< QVariant > &data)
Definition: ModelPartList.cpp:122
Model Part class.
Definition: ModelPart.h:51