summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/kernel/qguiapplication.cpp7
-rw-r--r--src/widgets/kernel/qapplication.cpp9
2 files changed, 7 insertions, 9 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index bab525f809..7adba40fbd 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -3299,7 +3299,7 @@ void QGuiApplication::setPalette(const QPalette &pal)
QCoreApplication::setAttribute(Qt::AA_SetPalette);
if (qGuiApp)
- emit qGuiApp->paletteChanged(*QGuiApplicationPrivate::app_pal);
+ qGuiApp->d_func()->sendApplicationPaletteChange();
}
void QGuiApplicationPrivate::applyWindowGeometrySpecificationTo(QWindow *window)
@@ -4101,7 +4101,6 @@ void QGuiApplicationPrivate::notifyThemeChanged()
if (!testAttribute(Qt::AA_SetPalette)) {
clearPalette();
initPalette();
- emit qGuiApp->paletteChanged(*app_pal);
sendApplicationPaletteChange();
}
if (!(applicationResourceFlags & ApplicationFontExplicitlySet)) {
@@ -4115,7 +4114,9 @@ void QGuiApplicationPrivate::notifyThemeChanged()
void QGuiApplicationPrivate::sendApplicationPaletteChange(bool toAllWidgets, const char *className)
{
Q_UNUSED(toAllWidgets)
- Q_UNUSED(className)
+
+ if (!className)
+ emit qGuiApp->paletteChanged(*QGuiApplicationPrivate::app_pal);
if (!is_app_running || is_app_closing)
return;
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 6120e0e164..9b1202c491 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -1390,14 +1390,11 @@ void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char*
hash->insert(className, pal);
}
+ if (!className && (!QApplicationPrivate::sys_pal || !palette.isCopyOf(*QApplicationPrivate::sys_pal)))
+ QCoreApplication::setAttribute(Qt::AA_SetPalette);
if (qApp)
qApp->d_func()->sendApplicationPaletteChange(all, className);
-
- if (!className && (!QApplicationPrivate::sys_pal || !palette.isCopyOf(*QApplicationPrivate::sys_pal))) {
- QCoreApplication::setAttribute(Qt::AA_SetPalette);
- emit qGuiApp->paletteChanged(*QGuiApplicationPrivate::app_pal);
- }
}
/*!
@@ -4433,7 +4430,7 @@ void QApplicationPrivate::sendApplicationPaletteChange(bool toAllWidgets, const
if (!is_app_running || is_app_closing)
return;
- QGuiApplicationPrivate::sendApplicationPaletteChange();
+ QGuiApplicationPrivate::sendApplicationPaletteChange(toAllWidgets, className);
QEvent event(QEvent::ApplicationPaletteChange);
const QWidgetList widgets = QApplication::allWidgets();