-
Notifications
You must be signed in to change notification settings - Fork 8
/
historydisplay.h
57 lines (39 loc) · 1.43 KB
/
historydisplay.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
#ifndef historydisplay_h
#define historydisplay_h
#include "port.h"
#include <QGroupBox>
#include <QSignalMapper>
#include <QLabel>
#include <QMessageBox>
const int MAX_HISTORY_ITEMS = 8;
const int HISTORY_ITEM_SIZE = 60;
class HistoryDisplay : public QObject
{
Q_OBJECT
public:
HistoryDisplay(QObject *parent = 0);
// LAYOUT ELEMENTS
QWidget *viewHistoryWidget;
QGroupBox *viewHistoryBox;
QVBoxLayout *viewHistoryBoxLayout;
QVBoxLayout *viewHistoryBoxOverallLayout;
QPushButton *clearHistoryButton;
QSignalMapper *viewMapper;
QSignalMapper *removeMapper;
QLabel *noItemLabel;
// used to call private addToHistory() function
void hide();
void show();
void triggerAddToHistory(const QDateTime &savedTime, const QString &filePathName, AbstractFunction *function, ColorWheel *colorwheel, Settings *settings);
void setPosition(QPoint point);
private slots:
void removePreview(QObject *item);
void clearAllHistory();
private:
// maps an instance's timestamp to its corresponding HistoryItem or HistoryItem Port object
QMap<QDateTime, HistoryItem*> historyItemsMap;
QMap<QDateTime, Port*> historyPortsMap;
// add a creation to the history list
void addToHistory(const QDateTime &savedTime, const QString &filePathName, AbstractFunction *function, ColorWheel *colorwheel, Settings *settings);
};
#endif /* historydisplay_h */