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>
This commit is contained in:
Tor Arne Vestbø 2019-06-21 14:04:46 +02:00
parent 6b06f12da6
commit f6a2b81eab

View File

@ -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();