-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdatelefttimethread.h
65 lines (56 loc) · 1.58 KB
/
updatelefttimethread.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
#ifndef UPDATELEFTTIMETHREAD_H
#define UPDATELEFTTIMETHREAD_H
#include <QObject>
#include <QThread>
#include <QPainter>
#include <QPen>
#include <QFont>
#include <QFontMetrics>
#include <QImage>
#include <QPixmap>
#include <QPixmapCache>
#include <QDirIterator>
#include <QList>
#include <QSound>
#include <QFile>
#include <QTextStream>
#include <QLinearGradient>
#include "mycalendar.h"
class UpdateLeftTimeThread : public QThread
{
Q_OBJECT
public:
UpdateLeftTimeThread();
~UpdateLeftTimeThread();
void applySkin(QString pathToSkin);
void setUpdateDelay(unsigned long delay);
void setBellEnable(bool enabled);
void run();
signals:
void drawTree(QPixmap*);
public slots:
void updateTime();
private:
QImage *image = nullptr;
MyCalendar *calendar = nullptr;
QPixmap *treePixmap = nullptr;
QString timeString;
QFont *timeFont = nullptr;
QFontMetrics *timeFontMetrics = nullptr;
QLinearGradient *fontGradient = nullptr;
QList<QImage*> *imageList = nullptr;
int imageIterator = 0;
uint countdownSleep = 0;
uint imageSleep = 0;
bool isActive = false;
bool isBellEnabled = false;
unsigned long updateDelay = 500;
void fillCache(QString pathToSkin);
void loadSkinConfig(QString pathToSkin);
void selectNextImage();
void setupFont(QString fontName, int fontSize);
QPen getPen();
template <typename T>
void releaseObject(T &pointer);
};
#endif // UPDATELEFTTIMETHREAD_H