diff options
| author | oldmud0 <oldmud0@users.noreply.github.com> | 2021-01-19 10:02:31 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-19 10:02:31 -0600 |
| commit | e097df09adc365db948858d2ab3bfff0f07e1143 (patch) | |
| tree | 39ea2ed35b536bdd5a06141398eb3bc379fccd09 /include/aoclocklabel.h | |
| parent | 0926f3c15842a71002c0ec374fd54832469036d8 (diff) | |
| parent | 1b016ddf91cb8b065215d046e7e0b4064b5d8633 (diff) | |
Merge pull request #384 from AttorneyOnline/feature/timerclock
Countdown timer
Diffstat (limited to 'include/aoclocklabel.h')
| -rw-r--r-- | include/aoclocklabel.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/aoclocklabel.h b/include/aoclocklabel.h new file mode 100644 index 00000000..b5d07945 --- /dev/null +++ b/include/aoclocklabel.h @@ -0,0 +1,29 @@ +#ifndef AOCLOCKLABEL_H +#define AOCLOCKLABEL_H + +#include <QLabel> +#include <QBasicTimer> +#include <QTimerEvent> +#include <QTime> +#include <QDebug> + +class AOClockLabel : public QLabel { + Q_OBJECT + +public: + AOClockLabel(QWidget *parent); + void start(); + void start(int msecs); + void set(int msecs, bool update_text = false); + void pause(); + void stop(); + +protected: + void timerEvent(QTimerEvent *event) override; + +private: + QBasicTimer timer; + QTime target_time; +}; + +#endif // AOCLOCKLABEL_H |
