add context holder & registry & bridge

This commit is contained in:
王劲鹏
2019-12-13 17:45:27 +08:00
parent 64fb425f01
commit 3fdedb6240
11 changed files with 85 additions and 18 deletions

View File

@@ -0,0 +1,11 @@
#include "context_manager.h"
#include "native_bridge.h"
Q_INVOKABLE void NativeBridge::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();
Context* context = ContextManager::getInstance()->getContext(contextId);
}

View File

@@ -11,13 +11,7 @@ class NativeBridge : public QObject {
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();
}
Q_INVOKABLE void function(int contextId, QString module, QString methodName, QString callbackId, QJSValue jsValue);
};
#endif // NATIVE_BRIDGE_H