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 <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Thomas Hartmann
2021-08-13 08:39:33 +02:00
parent a107a277b9
commit 2ab7176e79

View File

@@ -127,10 +127,10 @@ QString Theme::replaceCssColors(const QString &input)
void Theme::setupTheme(QQmlEngine *engine)
{
static const int typeIndex = qmlRegisterSingletonType<Utils::Theme>("QtQuickDesignerTheme", 1, 0,
"Theme", [](QQmlEngine *, QJSEngine *) {
return qobject_cast<QObject*>(new Theme(Utils::creatorTheme(), nullptr));
});
static const int typeIndex = qmlRegisterSingletonType<Theme>(
"QtQuickDesignerTheme", 1, 0, "Theme", [](QQmlEngine *engine, QJSEngine *) {
return new Theme(Utils::creatorTheme(), nullptr);
});
Q_UNUSED(typeIndex)
engine->addImageProvider(QLatin1String("icons"), new QmlDesignerIconProvider());