-
Notifications
You must be signed in to change notification settings - Fork 0
/
DlgSnapshotDetails.h
89 lines (41 loc) · 1.55 KB
/
DlgSnapshotDetails.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
75
76
77
78
79
80
81
82
83
84
85
// DlgSnapshotDetails.h
// Declares the DlgSnapshotDetails class representing the UI dialog to display details about a single snapshot
#ifndef DLGSNAPSHOTDETAILS_H
#define DLGSNAPSHOTDETAILS_H
#include <memory>
#include <QMainWindow>
#include <QTreeWidgetItem>
// fwd:
class Snapshot;
typedef std::shared_ptr<Snapshot> SnapshotPtr;
class Allocation;
typedef std::shared_ptr<Allocation> AllocationPtr;
namespace Ui
{
class DlgSnapshotDetails;
}
class DlgSnapshotDetails:
public QMainWindow
{
typedef QMainWindow Super;
Q_OBJECT
public:
explicit DlgSnapshotDetails(QWidget * a_Parent = nullptr);
/** Loads data from the specified snapshot and shows the window. */
void show(SnapshotPtr a_Snapshot);
private slots:
/** A tree item has expanded, make sure its children have correct child-indicators. */
void onTreeItemExpanded(QTreeWidgetItem * a_TreeItem);
private:
std::shared_ptr<Ui::DlgSnapshotDetails> m_UI;
/** The snapshot being displayed. */
SnapshotPtr m_Snapshot;
/** Updates all the items in the allocations tree widget. */
void updateAllocationsTree();
/** Inserts immediate children of the specified allocation into the specified tree item. */
void insertChildAllocations(QTreeWidgetItem * a_TreeItem, Allocation * a_Allocation);
/** For each child of the specified tree item, makes sure any applicable grandchildren are added.
This makes the child indicators correct for all children of a_TreeItem. */
void ensureCorrectChildIndicatorsForChildren(QTreeWidgetItem * a_TreeItem);
};
#endif // DLGSNAPSHOTDETAILS_H