
The timer's time as received by the server is clarified to be the actual numerical time, in milliseconds, to be shown on the clock.
30 lines
503 B
C++
30 lines
503 B
C++
#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
|