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