src/headerhistorymodel.h

Fri, 16 Mar 2018 16:28:39 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Fri, 16 Mar 2018 16:28:39 +0200
changeset 1291
9c570a30c98a
child 1292
66d2050d3bd9
permissions
-rw-r--r--

Added basic header editing

1291
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
1 #pragma once
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
2 #include <QAbstractTableModel>
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
3
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
4 class LDHeader;
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
5
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
6 class HeaderHistoryModel : public QAbstractTableModel
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
7 {
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
8 public:
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
9 enum Column
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
10 {
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
11 DateColumn,
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
12 AuthorColumn,
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
13 DescriptionColumn,
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
14 };
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
15
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
16 HeaderHistoryModel(LDHeader* header, QObject* parent);
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
17
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
18 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
19 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
20 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
21 void setHeader(LDHeader* header);
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
22 QVariant headerData(int section, Qt::Orientation orientation, int role) const;
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
23
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
24 private:
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
25 LDHeader* header;
9c570a30c98a Added basic header editing
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
26 };

mercurial