atrooney-online-2/include/aoclocklabel.h
Crystalwarrior f27f210efe Proof of concept complete. The timer will now take int msecs to start, and will properly display the time remaining until target time in hh:mm:ss.zzz
Clock can be defined in courtroom_config.ini and its font set in courtroom_fonts.ini
Pause and resume functions will not work as expected atm.
2020-08-21 18:01:24 +03:00

30 lines
471 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 pause();
void resume();
void stop();
protected:
void timerEvent(QTimerEvent *event) override;
private:
QBasicTimer timer;
QTime target_time;
};
#endif // AOCLOCKLABEL_H