aboutsummaryrefslogtreecommitdiff
path: root/include/aoclocklabel.h
blob: b5d07945f3fef10019a540bfdb29b62645b289e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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