diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-12-09 18:12:38 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-12-10 11:08:52 +0100 |
commit | 61d0128cee21ed75863d12491ac2fee58df094ec (patch) | |
tree | ab7d7521609ee5a7d3708e449cc87645f36265d7 /src/qml/doc/src | |
parent | b17b16d41b3ac5bd6d5d8d24f701f48b998c897f (diff) |
Document that you can use QJSValue as list type
Change-Id: I199d92f05f48f58349d5918e6615018e4b759576
Fixes: QTBUG-79028
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/qml/doc/src')
-rw-r--r-- | src/qml/doc/src/cppintegration/data.qdoc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/doc/src/cppintegration/data.qdoc b/src/qml/doc/src/cppintegration/data.qdoc index 171b2b6a11..6bf7dbfb8f 100644 --- a/src/qml/doc/src/cppintegration/data.qdoc +++ b/src/qml/doc/src/cppintegration/data.qdoc @@ -308,6 +308,11 @@ In both the Q_PROPERTY and return from Q_INVOKABLE cases, the elements of a std::vector are copied. This copying may be an expensive operation, so std::vector should be used judiciously. +You can also create a list-like data structure by constructing a QJSValue using +QJSEngine::newArray(). Such a JavaScript array does not need any conversion +when passing it between QML and C++. See \l{QJSValue#Working With Arrays} for +details on how to manipulate JavaScript arrays from C++. + Other sequence types are not supported transparently, and instead an instance of any other sequence type will be passed between QML and C++ as an opaque QVariantList. |