added timer

This commit is contained in:
2019-10-03 20:03:05 +02:00
parent 6319b6fee8
commit 77e61ec029
4 changed files with 236 additions and 31 deletions

View File

@@ -4,6 +4,7 @@
#include <QMainWindow>
#include <QSettings>
#include <QStateMachine>
#include <QTimer>
namespace Ui {
class MainWindow;
@@ -21,16 +22,22 @@ public:
private slots:
void on_btn_startstop_clicked();
void updateTime();
private:
Ui::MainWindow *ui;
QSettings* mSettings = nullptr;
QStateMachine mState;
QStateMachine mStateMachine;
QByteArray mCss;
QTimer mTimer;
int mTimeLeft = -1; // in seconds
void initStateMachine();
void triggerCssUpdate();
void keyPressEvent(QKeyEvent *event) override;
void timerToggled();
void shutdown();
};
}