aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/fusion/qquickfusiontheme.cpp
diff options
context:
space:
mode:
authorSanthosh Kumar <santhosh.kumar.selvaraj@qt.io>2022-12-07 14:20:08 +0100
committerSanthosh Kumar <santhosh.kumar.selvaraj@qt.io>2023-01-11 20:13:18 +0100
commitf043a3d0ffab41956dc30b9ac271026aa62a10e1 (patch)
tree06c31eb57fb4501ef8362faa5b1687f2a0d116af /src/quickcontrols/fusion/qquickfusiontheme.cpp
parent89ee6026ff5637c0e75d3234af1069846ed1c875 (diff)
Make the Controls Fusion theme use the platform palette by default
The Fusion theme used a custom palette, which doesn't work for all scenarios, such as palette changes in windows. This patch modifies the Fusion theme to use platform palettes instead, ensuring that runtime theme (light vs dark) and accent color changes in Windows (for example) are picked up. Any palette roles that the user has set via qtquickcontrols2.conf will still be respected, as that palette is resolved against the platform palette. Fixes: QTBUG-106931 Pick-to: 6.5 Change-Id: Ia78df5eb9b4752e044d252c19f16f7f52483466c Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Diffstat (limited to 'src/quickcontrols/fusion/qquickfusiontheme.cpp')
-rw-r--r--src/quickcontrols/fusion/qquickfusiontheme.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/quickcontrols/fusion/qquickfusiontheme.cpp b/src/quickcontrols/fusion/qquickfusiontheme.cpp
index 335d3be73f..9d8086b608 100644
--- a/src/quickcontrols/fusion/qquickfusiontheme.cpp
+++ b/src/quickcontrols/fusion/qquickfusiontheme.cpp
@@ -8,11 +8,11 @@
QT_BEGIN_NAMESPACE
-extern QPalette qt_fusionPalette();
-
void QQuickFusionTheme::initialize(QQuickTheme *theme)
{
- theme->setPalette(QQuickTheme::System, qt_fusionPalette());
+ // Enable platform palettes for fusion theme.
+ if (theme)
+ theme->setUsePlatformPalette(true);
}
QT_END_NAMESPACE