22 lines
406 B
C
22 lines
406 B
C
|
#ifndef TTIMER_H
|
||
|
#define TTIMER_H
|
||
|
|
||
|
#include <QThread>
|
||
|
|
||
|
class SyncTimer : public QThread {
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
int inter = 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 // TTIMER_H
|