diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2023-12-21 15:06:28 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2024-01-11 00:42:17 +0100 |
| commit | be481412cc704c1272833712ffe7df5ce8156775 (patch) | |
| tree | ab3ea0eda81bfba0cfed397cac5516377ae79e09 /tests/auto/qml/qmlcppcodegen/data | |
| parent | 953f0d44871b93a7a165e7026e48eaaadccf8d98 (diff) | |
QmlCompiler: Allow primitive conversion if output is stored in var
We can always convertStored() if the contained type has been fixed.
Pick-to: 6.7
Fixes: QTBUG-120322
Change-Id: I7d834fa32a12503341c863c095d578ca6e838531
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/convertPrimitiveToVar.qml | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt b/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt index 6d0c98f1f3..c82cacd089 100644 --- a/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt +++ b/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt @@ -103,6 +103,7 @@ set(qml_files conversionInDeadCode.qml conversions.qml conversions2.qml + convertPrimitiveToVar.qml convertQJSPrimitiveValueToIntegral.qml convertToOriginalReadAcumulatorForUnaryOperators.qml curlygrouped.qml diff --git a/tests/auto/qml/qmlcppcodegen/data/convertPrimitiveToVar.qml b/tests/auto/qml/qmlcppcodegen/data/convertPrimitiveToVar.qml new file mode 100644 index 0000000000..f7c2cc4058 --- /dev/null +++ b/tests/auto/qml/qmlcppcodegen/data/convertPrimitiveToVar.qml @@ -0,0 +1,18 @@ +pragma Strict +import QtQml + +QtObject { + id: foo + + property int offsetValue + + function send(data : variant) { + } + + Component.onCompleted: () => { + let deltaOffset = 42 + deltaOffset -= 1 + foo.offsetValue = deltaOffset + foo.send({offset: deltaOffset}) + } +} |
