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/engine/native/NativeExecutor.h
2021-05-20 18:27:45 +08:00

28 lines
553 B
C++

#ifndef NATIVEEXECUTOR_H
#define NATIVEEXECUTOR_H
#include <QJSEngine>
class NativeExecutor {
private:
QJSEngine *mJSEngine;
public:
NativeExecutor();
~NativeExecutor();
QString loadJS(QString script, QString source);
void injectGlobalJSObject(QString name, QObject *object);
void injectGlobalJSFunction(QString name, QObject *function,
QString property);
QJSValue invokeObject(QString objectName, QString functionName,
QVariantList arguments);
};
#endif // NATIVEEXECUTOR_H