From cfe0b08b5439a27b4fdd14c29620e0492543f506 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 13 Jan 2021 12:33:06 +0100 Subject: Remove QQmlCleanup The only place where it was still used is QQmlOpenMetaObjecType. The only effect of QQmlCleanup is that clear() is eventually called by the engine. In the case of QQmlOpenMetaObjectType the only effect of that was that the "engine" member was reset. However, the only place where that member was used was in setCached(), and in that place it was irrelevant. There is no reason why setCached() should be prohibited when there is no engine. We may be worried that the property cache assigned to the open metaobject might go away somehow if there is no engine, but the cleanup mechanism clearly demonstrates that checking for the engine on setCached() does not protect against this. Fixes: QTBUG-90004 Change-Id: I05445eaeb53a64c70de366090ea2ee4aecf2bad8 Reviewed-by: Fabian Kosmale --- tests/auto/qml/qqmlopenmetaobject/tst_qqmlopenmetaobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/qml/qqmlopenmetaobject/tst_qqmlopenmetaobject.cpp b/tests/auto/qml/qqmlopenmetaobject/tst_qqmlopenmetaobject.cpp index 44ce1d6987..6265c6ca67 100644 --- a/tests/auto/qml/qqmlopenmetaobject/tst_qqmlopenmetaobject.cpp +++ b/tests/auto/qml/qqmlopenmetaobject/tst_qqmlopenmetaobject.cpp @@ -52,7 +52,7 @@ void tst_qqmlopenmetaobject::createProperties() { QQmlEngine engine; CustomObject object; - const QQmlRefPointer mot = new QQmlOpenMetaObjectType(object.metaObject(), &engine); + const QQmlRefPointer mot = new QQmlOpenMetaObjectType(object.metaObject()); QQmlOpenMetaObject *const mo = new QQmlOpenMetaObject(&object, mot.data()); mo->setCached(true); mot->createProperty("customProperty"); -- cgit v1.2.3