diff options
author | Doris Verria <doris.verria@qt.io> | 2022-09-27 17:56:50 +0200 |
---|---|---|
committer | Doris Verria <doris.verria@qt.io> | 2022-10-10 15:48:28 +0200 |
commit | 2acd212acc6fdabcb88b9c9b999609d35941081f (patch) | |
tree | ba4659a3a33fc2661d86ff98970a3bdbffcd54f6 /src/gui/kernel/qguiapplication.cpp | |
parent | abbd9c91f5309924ac707706e3483747f44149a0 (diff) |
QGuiApp: Set QStyleHints's appearance based on platform theme
QStyleHintsPrivate::setAppearance was only called when the theme
changes, and up until then the reported QStyleHints::appearance()
was Unknown. To fix, the QGuiApplication should set the
appearance once the platform theme is created.
Change-Id: I5353031628d1f1a8b1e23bed0b2fb0bc0622cbe8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index f89043fbc6..ec5a9d3710 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1469,6 +1469,8 @@ void QGuiApplicationPrivate::createPlatformIntegration() Q_UNUSED(platformExplicitlySelected); init_platform(QLatin1StringView(platformName), platformPluginPath, platformThemeName, argc, argv); + if (const QPlatformTheme *theme = platformTheme()) + QStyleHintsPrivate::get(QGuiApplication::styleHints())->setAppearance(theme->appearance()); if (!icon.isEmpty()) forcedWindowIcon = QDir::isAbsolutePath(icon) ? QIcon(icon) : QIcon::fromTheme(icon); |