diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2023-04-17 12:44:09 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-04-24 22:22:14 +0200 |
| commit | fa259ed4ff84a5952cdb6d2c6215e92d65afa56a (patch) | |
| tree | 834b4cc6284ea0e54436d12ad0836e3c27c5c183 /tests/auto/qml/qmlcppcodegen/data | |
| parent | a7c92814f0ff6e9253c781b90e70ad645f8cd94e (diff) | |
QmlCompiler: Allow conversion from QQmlListProperty to QList
In the happy case this just retrieves the internal QList from the list
property. In the sad case it produces a deep copy. That's not worse than
what the interpreter does, though.
Fixes: QTBUG-112227
Change-Id: I8b2b0ac74c90b6dcee876e83a64502756733c1c5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/data')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/data/listConversion.qml | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt b/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt index 2bf8a0dbdc..01d02c03f9 100644 --- a/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt +++ b/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt @@ -137,6 +137,7 @@ set(qml_files library.js letAndConst.qml listAsArgument.qml + listConversion.qml listIndices.qml listPropertyAsModel.qml listlength.qml diff --git a/tests/auto/qml/qmlcppcodegen/data/listConversion.qml b/tests/auto/qml/qmlcppcodegen/data/listConversion.qml new file mode 100644 index 0000000000..0b08eb6033 --- /dev/null +++ b/tests/auto/qml/qmlcppcodegen/data/listConversion.qml @@ -0,0 +1,15 @@ +pragma Strict +import QtQml +import TestTypes + +BirthdayParty { + id: self + + guests: [ + Person { name: "Horst 1" }, + Person { name: "Horst 2" }, + Person { name: "Horst 3" } + ] + + property list<QtObject> o: self.guests +} |
