diff options
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 |
