-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMyDataModel.h
More file actions
31 lines (24 loc) · 961 Bytes
/
MyDataModel.h
File metadata and controls
31 lines (24 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef MYDATAMODEL_H
#define MYDATAMODEL_H
#include <QAbstractItemModel>
#include "TopData.h"
/**
* This is the model used to display our data.
*/
class MyDataModel: public QAbstractItemModel
{
Q_OBJECT
private:
PointerVector<TopData> & myData;
int depth(QModelIndex &index);
public:
MyDataModel(QObject *parent, PointerVector<TopData> *vec);
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
bool hasChildren(const QModelIndex &) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QModelIndex index ( int row, int column, const QModelIndex& parent = QModelIndex()) const override;
QModelIndex parent ( const QModelIndex& index ) const override;
};
#endif // MYDATAMODEL_H