aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2024-09-27 18:19:34 +0200
committerUlf Hermann <ulf.hermann@qt.io>2024-09-30 20:26:35 +0200
commit76ce5e4799f07e7cf4b9ffccf7cdfb5bc07de3c4 (patch)
tree27d550d2118d9d7d542631eed033035bdba16440 /tests/auto/qml/qmlcppcodegen/data
parentf8e68c4cd00d3ec36c21acc1cd089ae25af1c17d (diff)
QmlCompiler: Do not cache composite metatypes in static members
The metatypes from any old engines may have been deleted. Retrieve the types from the ResolveTypeReferenceMap instead. That is much cheaper than doing a full type search and the CU should know the types it's dealing with. Sometimes, however, the CU does not pre-resolve the types. In particular, types only used in function signatures do not end up in the ResolvedTypeReferenceMap. In those cases, still do the full type search. Amends commit 8bf5aae19b77b618f3f7a55a59e87c8a319475a8. Pick-to: 6.8.0 6.8 Task-number: QTBUG-129388 Change-Id: I27f25e1c68de3c752d00345c6d94016fb315e16c 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/Dummy.qml1
-rw-r--r--tests/auto/qml/qmlcppcodegen/data/invalidateCompositeType.qml17
3 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 2b88519f4e..73ff36ac22 100644
--- a/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt
+++ b/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt
@@ -174,6 +174,7 @@ set(qml_files
interactive.qml
interceptor.qml
internalConversion.qml
+ invalidateCompositeType.qml
invisibleBase.qml
invisibleListElementType.qml
invisibleTypes.qml
diff --git a/tests/auto/qml/qmlcppcodegen/data/Dummy.qml b/tests/auto/qml/qmlcppcodegen/data/Dummy.qml
index 70e2edc939..c965aa6719 100644
--- a/tests/auto/qml/qmlcppcodegen/data/Dummy.qml
+++ b/tests/auto/qml/qmlcppcodegen/data/Dummy.qml
@@ -6,6 +6,7 @@ Item {
enum DummyEnum { DummyValue1, DummyValue2, DummyValue3 = 33 }
property int value
property Dummy child
+ property Dummy2 child2 : Dummy2 {}
property int dummyEnum
component Group: QtObject {
diff --git a/tests/auto/qml/qmlcppcodegen/data/invalidateCompositeType.qml b/tests/auto/qml/qmlcppcodegen/data/invalidateCompositeType.qml
new file mode 100644
index 0000000000..1b060c07e7
--- /dev/null
+++ b/tests/auto/qml/qmlcppcodegen/data/invalidateCompositeType.qml
@@ -0,0 +1,17 @@
+pragma Strict
+import QtQml
+
+QtObject {
+ property Dummy d: Dummy {}
+
+ function returnDummy() : Dummy {
+ return d;
+ }
+
+ function returnDummy2() : Dummy2 {
+ return d.child2;
+ }
+
+ property Dummy d2: returnDummy()
+ property QtObject d3: returnDummy2();
+}