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

24 lines
681 B
C
Raw Normal View History

2019-12-04 15:51:46 +08:00
#ifndef NATIVE_BRIDGE_H
#define NATIVE_BRIDGE_H
#include <QDebug>
2019-12-12 17:29:35 +08:00
#include <QJSValue>
#include <QObject>
2019-12-04 15:51:46 +08:00
class NativeBridge : public QObject {
Q_OBJECT
public:
NativeBridge(QObject *parent = nullptr) : QObject(parent) {}
2019-12-12 17:29:35 +08:00
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();
2019-12-04 15:51:46 +08:00
}
};
#endif // NATIVE_BRIDGE_H