split project with app & doric module
This commit is contained in:
28
doric-Qt/example/doric/engine/DoricTimerExtension.h
Normal file
28
doric-Qt/example/doric/engine/DoricTimerExtension.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef NATIVETIMER_H
|
||||
#define NATIVETIMER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QSet>
|
||||
|
||||
class DoricTimerExtension : public QObject {
|
||||
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);
|
||||
|
||||
signals:
|
||||
void startTimer();
|
||||
};
|
||||
#endif // NATIVETIMER_H
|
||||
Reference in New Issue
Block a user