-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTableModel.h
More file actions
28 lines (21 loc) · 722 Bytes
/
Copy pathTableModel.h
File metadata and controls
28 lines (21 loc) · 722 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
#ifndef TABLEMODEL_H
#define TABLEMODEL_H
#include <qqml.h>
#include <QAbstractTableModel>
#include <DataModel.h>
class TableModel : public QAbstractTableModel
{
Q_OBJECT
public:
void setDataModel(DataModel* dataModel);
Q_INVOKABLE QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
int rowCount(const QModelIndex & = QModelIndex()) const override;
int columnCount(const QModelIndex & = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role) const override;
QHash<int, QByteArray> roleNames() const override;
public slots:
void onUpdate();
private:
DataModel* _dataModel;
};
#endif // TABLEMODEL_H