From 1d8cc1be879b6e956515ab8aac9bcd0e9f9c3134 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Mon, 21 Aug 2023 03:18:50 +0300 Subject: [PATCH] apply palette from the QGuiPlatformPlugin instance if it is not null palette from the config overrides even the platform plugin still (as it is with the style for example) Signed-off-by: Ivailo Monev --- src/gui/kernel/qapplication_x11.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 87f6ee919..7ab7a8bf0 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -599,9 +599,14 @@ bool QApplicationPrivate::x11_apply_settings() QColor(strlist[i])); } - // ### Fix properly for 4.6 - if (groupCount == QPalette::NColorGroups) + if (groupCount == QPalette::NColorGroups) { QApplicationPrivate::setSystemPalette(pal); + } else { + pal = qt_guiPlatformPlugin()->palette(); + if (pal != QPalette()) { + QApplicationPrivate::setSystemPalette(pal); + } + } QString fontDescription = settings.string(QLatin1String("Qt/font")); if (!fontDescription.isEmpty()) { -- 2.11.0