add native bridge function signature
This commit is contained in:
parent
f88b454e9e
commit
64fb425f01
@ -1,8 +1,9 @@
|
|||||||
#ifndef NATIVE_BRIDGE_H
|
#ifndef NATIVE_BRIDGE_H
|
||||||
#define NATIVE_BRIDGE_H
|
#define NATIVE_BRIDGE_H
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QJSValue>
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
class NativeBridge : public QObject {
|
class NativeBridge : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -10,8 +11,12 @@ class NativeBridge : public QObject {
|
|||||||
public:
|
public:
|
||||||
NativeBridge(QObject *parent = nullptr) : QObject(parent) {}
|
NativeBridge(QObject *parent = nullptr) : QObject(parent) {}
|
||||||
|
|
||||||
Q_INVOKABLE void function(int contextId) {
|
Q_INVOKABLE void function(int contextId, QString module, QString methodName, QString callbackId, QJSValue jsValue) {
|
||||||
qDebug() << "contextId: " + QString::number(contextId);
|
qDebug() << "contextId: " + QString::number(contextId) + ", " +
|
||||||
|
"module: " + module + ", " +
|
||||||
|
"methodName: " + methodName + ", " +
|
||||||
|
"callbackId: " + callbackId + ", " +
|
||||||
|
"arguments: " + jsValue.toString();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user