summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2020-01-31 20:38:41 +0100
committerMilian Wolff <milian.wolff@kdab.com>2020-02-04 09:48:38 +0100
commit2f5e7d048f291580a83677b415f4758aab04882a (patch)
tree2c9e53f6e5f585399e87d0af4e0c5a3e551c7375
parentc969b7b4c994d2e3f6fcd312e6c852d9b5414953 (diff)
downloadqtwebchannel-2f5e7d048f291580a83677b415f4758aab04882a.tar.gz
Fix documentation to use commonly working syntax for property changes
The "on" prefix and capitalization of the first letter in the change signal name is only done in QML, not in JavaScript. Furthermore, not all notify signals carry the new value in their signature. Adapt the example code to not show the "on" prefix and also use the more reliable approach to read a property value directly. Task-number: QTBUG-81782 Change-Id: I9c25e48c2d7abcdabbca88526f62c3d79eb952f8 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
-rw-r--r--src/webchannel/doc/src/javascript.qdoc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/webchannel/doc/src/javascript.qdoc b/src/webchannel/doc/src/javascript.qdoc
index ef44250..92170a0 100644
--- a/src/webchannel/doc/src/javascript.qdoc
+++ b/src/webchannel/doc/src/javascript.qdoc
@@ -89,8 +89,8 @@ new QWebChannel(yourTransport, function(channel) {
// To get notified about remote property changes,
// simply connect to the corresponding notify signal:
- foo.onMyPropertyChanged.connect(function(newValue) {
- console.log(newValue);
+ foo.myPropertyChanged.connect(function() {
+ console.log(foo.myProperty);
});
// One can also access enums that are marked with Q_ENUM: