From 8f85e82c5dc3d3028828e11ff59b16e3cae2844d Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 4 Jul 2016 08:07:42 +0200 Subject: [PATCH] Windows: Handle theme switching correctly if a palette is set If a palette is set on the application object and the user does something to trigger a theme change, i.e. connects via remote desktop or logs out and in again, then it will cause Qt to render incorrectly. Therefore we should only update the palette from the new theme if we don't have our own already set. Task-number: QTBUG-52962 Change-Id: I4e2288efd82ad98b698cc09f26ad188064ec7b2a Reviewed-by: Giuseppe D'Angelo Reviewed-by: Friedemann Kleint --- src/gui/kernel/qguiapplication.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 834449fec6..dec701a17d 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -3567,7 +3567,8 @@ QPixmap QGuiApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape) void QGuiApplicationPrivate::notifyThemeChanged() { - if (!(applicationResourceFlags & ApplicationPaletteExplicitlySet)) { + if (!(applicationResourceFlags & ApplicationPaletteExplicitlySet) && + !QCoreApplication::testAttribute(Qt::AA_SetPalette)) { clearPalette(); initPalette(); }