aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-11-01 18:56:32 +0100
committerUlf Hermann <ulf.hermann@qt.io>2023-11-04 01:29:26 +0100
commitd0484963f4b8839c3e43ad0d72e2bc6c4fbfb512 (patch)
treefab842128026ad55fcb95eeb41154711b9346f82 /tests/auto/qml/qmlcppcodegen/data
parentcebb3a732041d4254e8fd1a0b41e19f027351e92 (diff)
QmlCompiler: Allow internal conversions from wrapped original types
If an original type is merely wrapped into a more generic type by the basic blocks pass, we know the original data is still there and can be used for conversion. This happens if we assign the same value once via a shadowable lookup and once via an exactly typed one. The basic blocks pass then has to produce a QVariant for the shadowable lookup. However, we know that it can only contain the original type. Fixes: QTBUG-117800 Change-Id: I42335c3404dbcf8c1e7ad6427d22643ad490a345 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> 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.txt1
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/internalConversion.qml16
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt b/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt
index a128ba4caa..3924c75d1a 100644
--- a/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt
+++ b/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt
@@ -145,6 +145,7 @@ set(qml_files
intToEnum.qml
interactive.qml
interceptor.qml
+ internalConversion.qml
invisibleBase.qml
invisibleListElementType.qml
invisibleTypes.qml
diff --git a/tests/auto/qml/qmlcppcodegen/data/internalConversion.qml b/tests/auto/qml/qmlcppcodegen/data/internalConversion.qml
new file mode 100644
index 0000000000..7304b7a6b9
--- /dev/null
+++ b/tests/auto/qml/qmlcppcodegen/data/internalConversion.qml
@@ -0,0 +1,16 @@
+pragma Strict
+import QtQml
+
+QtObject {
+ property QtObject offset: QtObject {
+ id: a
+ property string mark
+ }
+
+ function markInputs(mark: string) {
+ offset.objectName = mark;
+ a.mark = mark;
+ }
+
+ Component.onCompleted: markInputs("hello")
+}