aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-02-10 16:25:47 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2020-02-10 16:32:39 +0100
commitc915ac23d9a460070ab4e4f8417df9db461c537c (patch)
tree49e705c181ccf7863698c144cde3f52ffa54c622 /src
parent4f0c9986069c690e8ed7a7d2b42dfbce5c492368 (diff)
QQmlEngine: Test that types are correctly removed
Amends 4f0c9986069c690e8ed7a7d2b42dfbce5c492368 Change-Id: I10a0d7988e1f5a003ccc80faa5b5c9bda62359cd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qml/qml/qqmlmetatype.cpp11
-rw-r--r--src/qml/qml/qqmlmetatype_p.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp
index 76816618ac..bff6a8a46f 100644
--- a/src/qml/qml/qqmlmetatype.cpp
+++ b/src/qml/qml/qqmlmetatype.cpp
@@ -298,6 +298,17 @@ bool QQmlMetaType::qmlRegisterModuleTypes(const QString &uri, int majorVersion)
return data->registerModuleTypes(QQmlMetaTypeData::VersionedUri(uri, majorVersion));
}
+/*!
+ \internal
+ Method is only used to in tst_qqmlenginecleanup.cpp to test whether all
+ types have been removed from qmlLists after shutdown of QQmlEngine
+ */
+int QQmlMetaType::qmlRegisteredListTypeCount()
+{
+ QQmlMetaTypeDataPtr data;
+ return data->qmlLists.count();
+}
+
void QQmlMetaType::clearTypeRegistrations()
{
//Only cleans global static, assumed no running engine
diff --git a/src/qml/qml/qqmlmetatype_p.h b/src/qml/qml/qqmlmetatype_p.h
index 037cf89beb..0c5bc043c4 100644
--- a/src/qml/qml/qqmlmetatype_p.h
+++ b/src/qml/qml/qqmlmetatype_p.h
@@ -202,6 +202,8 @@ public:
static void qmlRemoveModuleRegistration(const QString &uri, int majorVersion);
static bool qmlRegisterModuleTypes(const QString &uri, int majorVersion);
+
+ static int qmlRegisteredListTypeCount();
};
Q_DECLARE_TYPEINFO(QQmlMetaType, Q_MOVABLE_TYPE);