qt/LedOK/synctimer.h
2022-08-25 18:37:24 +08:00

23 lines
439 B
C++

#ifndef SYNCTIMER_H
#define SYNCTIMER_H
#include <QThread>
class SyncTimer : public QThread {
Q_OBJECT
public:
int inter = 0;
qint64 sleep = 0;
explicit SyncTimer(int inter = 0);
inline int interval(){return inter;}
inline void setInterval(int inter){this->inter = inter;}
public slots:
inline void stop(){inter = 0;}
signals:
void timeout();
protected:
void run() override;
};
#endif // SYNCTIMER_H