-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmytableview.h
More file actions
43 lines (32 loc) · 1.03 KB
/
mytableview.h
File metadata and controls
43 lines (32 loc) · 1.03 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef MYTABLEVIEW_H
#define MYTABLEVIEW_H
#include <QAbstractTableModel>
#include <QItemSelectionModel>
class MyTableView : public QAbstractTableModel
{
Q_OBJECT
public:
explicit MyTableView(QObject *parent = nullptr);
int rowCount(const QModelIndex & = QModelIndex()) const override;
int columnCount(const QModelIndex & = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
QHash<int, QByteArray> roleNames() const override;
int getColumnCount();
void selectionRow(int rowCount, int idxRow);
QItemSelectionModel *selectRowModel();
struct NodeFieldData
{
QString name;
QVariant value;
QString category;
};
struct NodeData
{
QVector<NodeFieldData> FieldData;
};
QVector<NodeData> Data;
private:
QItemSelectionModel *selectionModel;
};
#endif // MYTABLEVIEW_H