Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.12.6
-
None
Description
I tried to connect on property changes of a QtObject defined in QML and registered in the WebChannel. The documentation (https://doc.qt.io/qt-5/qtwebchannel-javascript.html) says to follow the QML style like:
// To get notified about remote property changes,
// simply connect to the corresponding notify signal:
foo.onMyPropertyChanged.connect(function(newValue)
);
However I found out eventually, by looking in the source code of qwebchannel.js, that the following convention is used:
notifySignalData[0] = propertyName + "Changed";
Without the "on" and capitilized first character. After figuring this out, the second problem is that the parameter in the callback (newValue) is always undefined. Maybe this is intended and the workaround or (actualy intended workflow?) is to read the updated property directly.
Please update the documentation to avoid unneeded debugging issues.
Attachments
For Gerrit Dashboard: QTBUG-81782 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
288839,2 | Fix documentation to use commonly working syntax for property changes | 5.15 | qt/qtwebchannel | Status: MERGED | +2 | 0 |