-
Notifications
You must be signed in to change notification settings - Fork 0
/
worldtimewidget.h
71 lines (56 loc) · 1.34 KB
/
worldtimewidget.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
#ifndef WORLDTIMEWIDGET_H
#define WORLDTIMEWIDGET_H
#include <QTimeZone>
#include <QWidget>
#include <QJsonObject>
namespace Ui {
class WorldTimeWidget;
class InfoWidget;
}
class WorldTimeWidget : public QWidget
{
Q_OBJECT
public:
explicit WorldTimeWidget();
~WorldTimeWidget();
QWidget* InfoWidgetBox;
void SetTimeZone(QTimeZone time_zone);
void SetCountryName(QString country, QString city);
void SetMarketAlert(bool alert);
void SetPannelColor(QColor color);
QColor PannelColor();
static const QSize ItemSize;
static const QSize InfoItemSize;
void FromJson(QJsonObject obj);
QJsonObject ToJson();
private:
Ui::WorldTimeWidget *ui;
QPoint MousePressedPos;
QPoint WindowPos;
struct PImpl;
PImpl* Impl;
private:
void mouseMoveEvent(QMouseEvent* e);
void mousePressEvent(QMouseEvent* e);
public slots:
void UpdateSyncDateTime();
void SetStayOnTop(bool value);
signals:
void RemoveRequest();
void AlertRequest();
};
class InfoWidget : public QWidget
{
Q_OBJECT
friend class WorldTimeWidget;
private:
void BuildTimeZoneList();
private slots:
void UpdateFields();
void OpenChoseColor();
private:
Ui::InfoWidget *ui;
InfoWidget(WorldTimeWidget *parent = nullptr);
WorldTimeWidget *Parent = nullptr;
};
#endif // WORLDTIMEWIDGET_H