aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/aoclocklabel.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/aoclocklabel.h b/include/aoclocklabel.h
new file mode 100644
index 00000000..518cae7b
--- /dev/null
+++ b/include/aoclocklabel.h
@@ -0,0 +1,29 @@
+#ifndef AOCLOCKLABEL_H
+#define AOCLOCKLABEL_H
+
+#include <QLabel>
+#include <QBasicTimer>
+#include <QTimerEvent>
+#include <QTime>
+
+class AOClockLabel : public QLabel {
+ Q_OBJECT
+
+public:
+ AOClockLabel(QWidget *parent);
+ void start();
+ void start(QTime p_time);
+ void pause();
+ void resume();
+ void stop();
+
+protected:
+ void timerEvent(QTimerEvent *event) override;
+
+private:
+ QBasicTimer timer;
+ QTime starting_time;
+ QTime target_time;
+};
+
+#endif // AOCLOCKLABEL_H