Update to support both Qt 4 and Qt 5
[apps/thermostat-demo.git] / thermostatwidget.h
1 #ifndef THERMOSTATWIDGET_H\r
2 #define THERMOSTATWIDGET_H\r
3 \r
4 #include <qglobal.h>\r
5 #include <QtGui>\r
6 \r
7 #if QT_VERSION >= 0x050000\r
8 \r
9 #include <QPushButton>\r
10 #include <QLabel>\r
11 #include <QHBoxLayout>\r
12 #include <QVBoxLayout>\r
13 \r
14 #endif\r
15 \r
16 class GlobalSettings;\r
17 \r
18 class ThermostatWidget : public QWidget\r
19 {\r
20     Q_OBJECT\r
21 public:\r
22     explicit ThermostatWidget(QWidget *parent = 0);\r
23     static int currentTempStatic;\r
24     QLabel *currentTemp;\r
25 \r
26 public slots:\r
27     void updateUnit();\r
28     void setCurrentTempPtr(int * currentTemp);\r
29     void increaseTemp();\r
30     void decreaseTemp();\r
31     QHash<QString, QVariant> getCurrentData();\r
32     \r
33 signals:\r
34     void timeout();\r
35     void setpointIsReached(bool);\r
36     \r
37 private slots:\r
38     void update();\r
39     void resizeEvent(QResizeEvent *);\r
40 \r
41 private:\r
42     int *currentTempInt;\r
43     int setpointTempInt;\r
44     QLabel *setpointTemp;\r
45     QPushButton *increaseTempButton;\r
46     QPushButton *decreaseTempButton;\r
47     QTimer *updateTimer;\r
48     bool setpointReached;\r
49     GlobalSettings *m_globalSettings;\r
50 };\r
51 \r
52 #endif // THERMOSTATWIDGET_H\r