summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-06-21 14:04:46 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-12-12 23:24:11 +0100
commitf6a2b81eabae81110f678263be8558c24072c458 (patch)
tree0eef26dc93da91fdf4f76a88fdb66a4ec40970d2 /src/widgets/kernel
parent6b06f12da6d5171d02764e9d6636c59731e2289f (diff)
Update system palette on application init if needed
A style may have been set before the application was created, which would have resulted in setting the system palette based on the style's palette. Once the application is initialized and we have a platform theme we need to reset the system palette. Change-Id: Ia48f57d3983535c8633741d8027f75bc0c214018 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qapplication.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 37948ecd8c..f546ec9187 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -555,6 +555,12 @@ void QApplicationPrivate::init()
// Must be called before initialize()
QColormap::initialize();
+ if (sys_pal) {
+ // Now that we have a platform theme we need to reset
+ // the system palette to pick up the theme colors.
+ clearSystemPalette();
+ initSystemPalette();
+ }
qt_init_tooltip_palette();
QApplicationPrivate::initializeWidgetFontHash();