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/native/native_bridge.h
2019-12-12 17:29:35 +08:00

24 lines
681 B
C++

#ifndef NATIVE_BRIDGE_H
#define NATIVE_BRIDGE_H
#include <QDebug>
#include <QJSValue>
#include <QObject>
class NativeBridge : public QObject {
Q_OBJECT
public:
NativeBridge(QObject *parent = nullptr) : QObject(parent) {}
Q_INVOKABLE void function(int contextId, QString module, QString methodName, QString callbackId, QJSValue jsValue) {
qDebug() << "contextId: " + QString::number(contextId) + ", " +
"module: " + module + ", " +
"methodName: " + methodName + ", " +
"callbackId: " + callbackId + ", " +
"arguments: " + jsValue.toString();
}
};
#endif // NATIVE_BRIDGE_H