This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-Qt/doric/native/native_timer.h

28 lines
536 B
C
Raw Normal View History

2019-12-04 15:51:46 +08:00
#ifndef NATIVE_TIMER_H
#define NATIVE_TIMER_H
#include <QJSEngine>
#include <QObject>
#include <QSet>
#include "constant.h"
class NativeTimer : public QObject {
Q_OBJECT
private:
QSet<long> *deletedTimerIds = new QSet<long>();
2019-12-13 17:48:37 +08:00
QJSEngine *engine;
2019-12-04 15:51:46 +08:00
public:
2019-12-13 17:48:37 +08:00
NativeTimer(QJSEngine *engine, QObject *parent = nullptr) : QObject(parent) {
2019-12-04 15:51:46 +08:00
this->engine = engine;
}
2019-12-14 10:04:17 +08:00
Q_INVOKABLE void setTimer(long timerId, int time, bool repeat);
2019-12-04 15:51:46 +08:00
2019-12-14 10:04:17 +08:00
Q_INVOKABLE void clearTimer(long timerId);
2019-12-04 15:51:46 +08:00
};
#endif // NATIVE_TIMER_H