From 2ab7176e79d12c6a9d32582416c25b7f1ce88c23 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 13 Aug 2021 08:39:33 +0200 Subject: [PATCH] QmlDesigner: Clean up singleton generation The singleton is of type QmlDesigner::Theme and there is no reason for the QObject cast. Change-Id: I352f3e455de8233c914f37ba93e2313a3a6357fe Reviewed-by: Qt CI Bot Reviewed-by: Thomas Hartmann --- .../qmldesigner/components/componentcore/theme.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmldesigner/components/componentcore/theme.cpp b/src/plugins/qmldesigner/components/componentcore/theme.cpp index cb5cdb218e8..a2fea95603d 100644 --- a/src/plugins/qmldesigner/components/componentcore/theme.cpp +++ b/src/plugins/qmldesigner/components/componentcore/theme.cpp @@ -127,10 +127,10 @@ QString Theme::replaceCssColors(const QString &input) void Theme::setupTheme(QQmlEngine *engine) { - static const int typeIndex = qmlRegisterSingletonType("QtQuickDesignerTheme", 1, 0, - "Theme", [](QQmlEngine *, QJSEngine *) { - return qobject_cast(new Theme(Utils::creatorTheme(), nullptr)); - }); + static const int typeIndex = qmlRegisterSingletonType( + "QtQuickDesignerTheme", 1, 0, "Theme", [](QQmlEngine *engine, QJSEngine *) { + return new Theme(Utils::creatorTheme(), nullptr); + }); Q_UNUSED(typeIndex) engine->addImageProvider(QLatin1String("icons"), new QmlDesignerIconProvider());