From c49c96fbb13912a749942f8f90a6d91656a11852 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Sun, 1 Sep 2013 12:03:57 +0300 Subject: Reinitialize system palette when setting a new style. Task-number: QTBUG-29565 Change-Id: I5ac95d52c453aec9e2160a135dc1afdd9583eed3 Reviewed-by: Eskil Abrahamsen Blomfeldt Reviewed-by: BogDan Vatra --- src/widgets/kernel/qapplication_qpa.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/widgets/kernel/qapplication_qpa.cpp') diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp index b947f1b497..1f8e950d00 100644 --- a/src/widgets/kernel/qapplication_qpa.cpp +++ b/src/widgets/kernel/qapplication_qpa.cpp @@ -275,6 +275,8 @@ void QApplicationPrivate::initializeWidgetPaletteHash() QPlatformTheme *platformTheme = QGuiApplicationPrivate::platformTheme(); if (!platformTheme) return; + qt_app_palettes_hash()->clear(); + setPossiblePalette(platformTheme->palette(QPlatformTheme::ToolButtonPalette), "QToolButton"); setPossiblePalette(platformTheme->palette(QPlatformTheme::ButtonPalette), "QAbstractButton"); setPossiblePalette(platformTheme->palette(QPlatformTheme::CheckBoxPalette), "QCheckBox"); @@ -298,6 +300,8 @@ void QApplicationPrivate::initializeWidgetFontHash() if (!theme) return; FontHash *fontHash = qt_app_fonts_hash(); + fontHash->clear(); + if (const QFont *font = theme->font(QPlatformTheme::MenuFont)) fontHash->insert(QByteArrayLiteral("QMenu"), *font); if (const QFont *font = theme->font(QPlatformTheme::MenuBarFont)) -- cgit v1.2.3