atrooney-online-2/include/aoclocklabel.h
oldmud0 de3533fbf2 Rework timer and ping logic
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.
2021-01-09 01:18:19 -06:00

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