Sat, 17 Mar 2018 12:29:52 +0200
Added a new tool for clamping vertices
1291 | 1 | #pragma once |
2 | #include <QAbstractTableModel> | |
3 | ||
4 | class LDHeader; | |
5 | ||
6 | class HeaderHistoryModel : public QAbstractTableModel | |
7 | { | |
8 | public: | |
9 | enum Column | |
10 | { | |
11 | DateColumn, | |
12 | AuthorColumn, | |
13 | DescriptionColumn, | |
14 | }; | |
15 | ||
16 | HeaderHistoryModel(LDHeader* header, QObject* parent); | |
17 | ||
1292
66d2050d3bd9
Part history can now be edited
Teemu Piippo <teemu@hecknology.net>
parents:
1291
diff
changeset
|
18 | int rowCount(const QModelIndex& parent = {}) const override; |
66d2050d3bd9
Part history can now be edited
Teemu Piippo <teemu@hecknology.net>
parents:
1291
diff
changeset
|
19 | int columnCount(const QModelIndex& parent = {}) const override; |
66d2050d3bd9
Part history can now be edited
Teemu Piippo <teemu@hecknology.net>
parents:
1291
diff
changeset
|
20 | QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; |
66d2050d3bd9
Part history can now be edited
Teemu Piippo <teemu@hecknology.net>
parents:
1291
diff
changeset
|
21 | bool setData(const QModelIndex& index, const QVariant& value, int role) override; |
1291 | 22 | void setHeader(LDHeader* header); |
1292
66d2050d3bd9
Part history can now be edited
Teemu Piippo <teemu@hecknology.net>
parents:
1291
diff
changeset
|
23 | QVariant headerData(int section, Qt::Orientation orientation, int role) const override; |
66d2050d3bd9
Part history can now be edited
Teemu Piippo <teemu@hecknology.net>
parents:
1291
diff
changeset
|
24 | bool insertRows(int row, int count, const QModelIndex&) override; |
66d2050d3bd9
Part history can now be edited
Teemu Piippo <teemu@hecknology.net>
parents:
1291
diff
changeset
|
25 | bool removeRows(int row, int count, const QModelIndex&) override; |
66d2050d3bd9
Part history can now be edited
Teemu Piippo <teemu@hecknology.net>
parents:
1291
diff
changeset
|
26 | bool moveRows( |
66d2050d3bd9
Part history can now be edited
Teemu Piippo <teemu@hecknology.net>
parents:
1291
diff
changeset
|
27 | const QModelIndex&, |
66d2050d3bd9
Part history can now be edited
Teemu Piippo <teemu@hecknology.net>
parents:
1291
diff
changeset
|
28 | int sourceRow, |
66d2050d3bd9
Part history can now be edited
Teemu Piippo <teemu@hecknology.net>
parents:
1291
diff
changeset
|
29 | int count, |
66d2050d3bd9
Part history can now be edited
Teemu Piippo <teemu@hecknology.net>
parents:
1291
diff
changeset
|
30 | const QModelIndex&, |
66d2050d3bd9
Part history can now be edited
Teemu Piippo <teemu@hecknology.net>
parents:
1291
diff
changeset
|
31 | int destinationRow |
66d2050d3bd9
Part history can now be edited
Teemu Piippo <teemu@hecknology.net>
parents:
1291
diff
changeset
|
32 | ) override; |
66d2050d3bd9
Part history can now be edited
Teemu Piippo <teemu@hecknology.net>
parents:
1291
diff
changeset
|
33 | Qt::ItemFlags flags(const QModelIndex& index) const override; |
1291 | 34 | |
35 | private: | |
36 | LDHeader* header; | |
37 | }; |