aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-03-09 01:00:06 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-03-09 09:58:49 +0100
commitd51d5ff3c187821929cf7b765e037423bcc90466 (patch)
tree0eed81eb1709759058ff2b3b4595ea18774a44c4 /src/qml/doc
parenteacb1a08ee4dace7c12a6eed153b9ec69cf95966 (diff)
parent12ddd8da1b2dcfbbca10a6915547456601a726c0 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: src/qml/compiler/qqmlirbuilder_p.h src/qml/qml/qqmlpropertycachecreator_p.h src/qmltyperegistrar/qmltypesclassdescription.cpp src/qmltyperegistrar/qmltypesclassdescription.h src/qmltyperegistrar/qmltypescreator.cpp src/quick/items/qquicktext_p.h src/quick/util/qquickvaluetypes_p.h Change-Id: Ic209741592e7b85820bf3845722023a190ebc1c5
Diffstat (limited to 'src/qml/doc')
-rw-r--r--src/qml/doc/src/cppintegration/data.qdoc19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/qml/doc/src/cppintegration/data.qdoc b/src/qml/doc/src/cppintegration/data.qdoc
index 4095cd22ea..9dfb7837e5 100644
--- a/src/qml/doc/src/cppintegration/data.qdoc
+++ b/src/qml/doc/src/cppintegration/data.qdoc
@@ -197,6 +197,25 @@ type or method parameter, the value can be created as a JavaScript array or
object in QML, and is automatically converted to a QVariantList or QVariantMap
when it is passed to C++.
+Mind that QVariantList and QVariantMap properties of C++ types are stored as
+values and cannot be changed in place by QML code. You can only replace the
+whole map or list, but not manipulate its contents. The following code does
+not work if the property \c l is a QVariantList:
+
+\code
+MyListExposingItem {
+ l: [1, 2, 3]
+ Component.onCompleted: l[0] = 10
+}
+\endcode
+
+The following code does work:
+\code
+MyListExposingItem {
+ l: [1, 2, 3]
+ Component.onCompleted: l = [10, 2, 3]
+}
+\endcode
\section2 QDateTime to JavaScript Date