Details
-
Suggestion
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
5.9.4
-
None
Description
#3 from QTBUG-67592
Assuming the QObject* 'o' is already exposed to the scripting side, as a property of another QObject for ex. Calling slot(o) fails with the following error message "Cannot not convert non-object argument xxx to QObject*.", even though the QObject was published to javascript by Qt without problem. (all its properties, slots, can be seen in Chrome/Inspect).
This is because QMetaObjectPublisher looks for a value for the "id" field on the Json data provided from javascript and doesn't find it. In fact it is not symetrical with what qwebchannel.js is doing: the script fills a '_id_' field instead.
To test I modified the qwebchannel.js as follow:
function QObject(name, data, webChannel) { this.__id__ = name; this.id = name; // CC: QMetaObjectPublisher looks for KEY_ID = "id" when calling unwrapObject(value.toObject()[KEY_ID].toString()); ...