-
Notifications
You must be signed in to change notification settings - Fork 1
/
statuswidget.h
81 lines (70 loc) · 1.55 KB
/
statuswidget.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
#ifndef CSTATUSWIDGET_H
#define CSTATUSWIDGET_H
#include <QDockWidget>
#include <QTextEdit>
#include <QTime>
#include <QLabel>
#include <QGridLayout>
#include <QQueue>
/**
* @brief
* A class as a data type for texts used in Status Widget
*/
class CStatusText
{
public:
CStatusText(QString _text = "", QColor _color = QColor("black"), int _size = 12)
{
text= _text;
color = _color;
size = _size;
}
QString text;
QColor color;
int size;
};
/**
* @brief
* Just a queue, implemeted as class so that I can add 4 different Queues for each player later (that was the idea)
*/
class CStatusPrinter
{
public:
CStatusPrinter() {}
QQueue<CStatusText> textBuffer; /**< TODO */
};
class CStatusWidget : public QDockWidget
{
Q_OBJECT
public:
CStatusWidget(CStatusPrinter* _statusPrinter);
~CStatusWidget();
QTextEdit *statusText; /**< Text area */
QLabel *titleLbl;
QTextDocument content; /**< Text is stored in this document */
public slots:
void write(QString str, QColor color = QColor("black"));
/**
* @brief
* updates the status bar information
*/
void update();
private:
CStatusPrinter *statusPrinter;
QTime logTime; /**< Time from start of program, is printed before each output in status bar */
signals:
/**
* @brief
* Not used in this version
* @param bool
*/
void closeSignal(bool);
protected:
/**
* @brief
* emmits the closeSignal
* @param
*/
void closeEvent(QEvent*);
};
#endif // CSTATUSWIDGET_H