Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.6.0
-
None
-
Server: Qt 5.6.0 on ARM running embedded Linux
Client: node.js on Ubuntu
Description
Signal parameters that are of type QObject are not converted to object references at the client when the signal is emitted.
For example, at the server:
class SomeClass : public QObject { ... signals: void testSignal(QObject*); ... }
At a JavaScript client:
obj.testSignal.connect(function(objParam) {
console.log(objParam.__id__);
});
The above will log "undefined" to the console with the signal is emitted.
The server does appear to properly serialize the object reference, so the following change to qwebchannel.js seems to help:
this.signalEmitted = function(signalName, signalArgs) { - invokeSignalCallbacks(signalName, signalArgs); + invokeSignalCallbacks(signalName, this.unwrapQObject(signalArgs)); }