aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2021-08-13 08:39:33 +0200
committerThomas Hartmann <thomas.hartmann@qt.io>2021-08-16 08:28:34 +0000
commit2ab7176e79d12c6a9d32582416c25b7f1ce88c23 (patch)
treeb52a3ad2f48d44f4a049ce6c649133d2cdb1b3b1
parenta107a277b945bd0da824005211c43535efccdf6d (diff)
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>
-rw-r--r--src/plugins/qmldesigner/components/componentcore/theme.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/qmldesigner/components/componentcore/theme.cpp b/src/plugins/qmldesigner/components/componentcore/theme.cpp
index cb5cdb218e..a2fea95603 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<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());