-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSnapshotDiffModel.h
71 lines (41 loc) · 1.26 KB
/
SnapshotDiffModel.h
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// SnapshotDiffModel.h
// Declares the SnapshotDiffModel class representing a Qt model for visualising the snapshot diff
#ifndef SNAPSHOTDIFFMODEL_H
#define SNAPSHOTDIFFMODEL_H
#include <memory>
#include <QAbstractItemModel>
// fwd:
class SnapshotDiff;
typedef std::shared_ptr<SnapshotDiff> SnapshotDiffPtr;
class SnapshotDiffModel:
public QAbstractItemModel
{
typedef QAbstractItemModel Super;
Q_OBJECT
public:
enum
{
dataRoleSort = 1038,
};
explicit SnapshotDiffModel(SnapshotDiffPtr a_Diff);
protected:
/** The diff represented by this model. */
SnapshotDiffPtr m_Diff;
// QAbstractItemModel overrides:
virtual QVariant data(const QModelIndex & a_Index, int a_Role) const override;
virtual Qt::ItemFlags flags(const QModelIndex & a_Index) const override;
QVariant headerData(
int a_Section,
Qt::Orientation a_Orientation,
int a_Role = Qt::DisplayRole
) const override;
QModelIndex index(
int a_Row,
int a_Column,
const QModelIndex & a_Parent = QModelIndex()
) const override;
QModelIndex parent(const QModelIndex & a_Index) const override;
int rowCount(const QModelIndex & a_Parent = QModelIndex()) const override;
int columnCount(const QModelIndex & a_Parent = QModelIndex()) const override;
};
#endif // SNAPSHOTDIFFMODEL_H