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/example/doric/engine/DoricTimerExtension.h

31 lines
632 B
C
Raw Normal View History

2021-02-04 16:59:58 +08:00
#ifndef NATIVETIMER_H
#define NATIVETIMER_H
#include <QObject>
#include <QSet>
2021-05-18 16:15:28 +08:00
#include "DoricExport.h"
class DORIC_EXPORT DoricTimerExtension : public QObject {
2021-02-04 16:59:58 +08:00
Q_OBJECT
private:
QSet<long> *deletedTimerIds = new QSet<long>();
std::function<void(long)> method;
public:
explicit DoricTimerExtension(std::function<void(long)> method,
QObject *parent = nullptr)
: QObject(parent) {
this->method = method;
}
Q_INVOKABLE void setTimer(long timerId, int time, bool repeat);
Q_INVOKABLE void clearTimer(long timerId);
2021-04-06 17:58:23 +08:00
signals:
void startTimer();
2021-02-04 16:59:58 +08:00
};
#endif // NATIVETIMER_H