aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2024-01-22 22:38:27 +0200
committerTarja Sundqvist <tarja.sundqvist@qt.io>2024-02-20 10:05:13 +0000
commit302ab20d46280e11042f3896460c55d8b8146e41 (patch)
tree3cef87d6ca24d2e37a3dc8c4af4506e510903a78 /tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
parent02277e3753613d9e19bbb36367c7d2b1d13d7545 (diff)
parenta7df6331b29e44ed364fcd7297c4e1bc6ce2167c (diff)
Merge remote-tracking branch 'origin/tqtc/lts-6.2.8' into tqtc/lts-6.2-opensource
Conflicts solved in a file: dependencies.yaml Change-Id: Ib4083daa41a689b937d2aeb522e93e3aab0be1c4
Diffstat (limited to 'tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp')
-rw-r--r--tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
index be493484ee..f726855727 100644
--- a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
+++ b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
@@ -72,6 +72,8 @@ private slots:
void enumsInRecursiveImport_data();
void enumsInRecursiveImport();
+
+ void clearPropertyCaches();
};
class TestType : public QObject
@@ -734,6 +736,24 @@ void tst_qqmlmetatype::enumsInRecursiveImport()
QTRY_COMPARE(obj->property("color").toString(), QString("green"));
}
+void tst_qqmlmetatype::clearPropertyCaches()
+{
+ qmlClearTypeRegistrations();
+ qmlRegisterType<TestType>("ClearPropertyCaches", 1, 0, "A");
+
+ QQmlRefPointer<QQmlPropertyCache> oldCache(
+ QQmlMetaType::propertyCache(&TestType::staticMetaObject));
+ QVERIFY(oldCache);
+
+ qmlClearTypeRegistrations();
+ qmlRegisterType<TestType>("ClearPropertyCaches", 1, 0, "B");
+ QQmlRefPointer<QQmlPropertyCache> newCache(
+ QQmlMetaType::propertyCache(&TestType::staticMetaObject));
+ QVERIFY(newCache);
+
+ QVERIFY(oldCache.data() != newCache.data());
+}
+
QTEST_MAIN(tst_qqmlmetatype)
#include "tst_qqmlmetatype.moc"