qt/LedOK/synctimer.h

23 lines
439 B
C
Raw Normal View History

2022-08-25 18:37:24 +08:00
#ifndef SYNCTIMER_H
#define SYNCTIMER_H
2022-01-20 10:08:17 +08:00
#include <QThread>
class SyncTimer : public QThread {
Q_OBJECT
public:
int inter = 0;
2022-08-25 18:37:24 +08:00
qint64 sleep = 0;
2022-01-20 10:08:17 +08:00
explicit SyncTimer(int inter = 0);
inline int interval(){return inter;}
inline void setInterval(int inter){this->inter = inter;}
public slots:
2022-08-25 18:37:24 +08:00
inline void stop(){inter = 0;}
2022-01-20 10:08:17 +08:00
signals:
void timeout();
protected:
void run() override;
};
2022-08-25 18:37:24 +08:00
#endif // SYNCTIMER_H