-
Notifications
You must be signed in to change notification settings - Fork 0
/
DlgSnapshotDiffs.h
74 lines (41 loc) · 1.29 KB
/
DlgSnapshotDiffs.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
72
73
74
// DlgSnapshotDiffs.h
// Declares the DlgSnapshotDiffs class representing the dialog for displaying multiple diffs between snapshots
#ifndef DLGSNAPSHOTDIFFS_H
#define DLGSNAPSHOTDIFFS_H
#include <memory>
#include <vector>
#include <QMainWindow>
#include <QSortFilterProxyModel>
// fwd:
class SnapshotDiff;
typedef std::shared_ptr<SnapshotDiff> SnapshotDiffPtr;
typedef std::vector<SnapshotDiffPtr> SnapshotDiffPtrs;
class SnapshotDiffModel;
typedef std::shared_ptr<SnapshotDiffModel> SnapshotDiffModelPtr;
namespace Ui
{
class DlgSnapshotDiffs;
}
class DlgSnapshotDiffs:
public QMainWindow
{
typedef QMainWindow Super;
Q_OBJECT
public:
explicit DlgSnapshotDiffs(QWidget * a_Parent = nullptr);
/** Shows the dialog with the specified diffs filled in. */
void show(SnapshotDiffPtrs && a_Diffs);
private slots:
void onCurrentDiffChanged();
private:
/** QtCreator-managed UI. */
std::shared_ptr<Ui::DlgSnapshotDiffs> m_UI;
/** The diffs that are being shown. */
SnapshotDiffPtrs m_Diffs;
/** The models for the diffs being show.
The models are lazily created and cached. */
std::map<SnapshotDiff *, SnapshotDiffModelPtr> m_Models;
/** The sorting proxy model for the diff model. */
std::shared_ptr<QSortFilterProxyModel> m_SortingModel;
};
#endif // DLGSNAPSHOTDIFFS_H