diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-06-25 18:42:59 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-12-17 20:19:37 +0100 |
commit | 04f5008f51dee9feec68afcee8cd8314b8e5ac62 (patch) | |
tree | 85cefe55ede43ffb789535e4a4e38d9cbd598a0f /src/gui | |
parent | 87cedab94e4ca17e8c77602c0d1d285e3c68cb83 (diff) |
Let sendApplicationPaletteChange() decide when it needs to exit early
Change-Id: I7a8e6c0b54d2a16a17b292a4102e05f743bcbe29
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index e534ba377f..bab525f809 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -4102,8 +4102,7 @@ void QGuiApplicationPrivate::notifyThemeChanged() clearPalette(); initPalette(); emit qGuiApp->paletteChanged(*app_pal); - if (is_app_running && !is_app_closing) - sendApplicationPaletteChange(); + sendApplicationPaletteChange(); } if (!(applicationResourceFlags & ApplicationFontExplicitlySet)) { const auto locker = qt_scoped_lock(applicationFontMutex); @@ -4118,6 +4117,9 @@ void QGuiApplicationPrivate::sendApplicationPaletteChange(bool toAllWidgets, con Q_UNUSED(toAllWidgets) Q_UNUSED(className) + if (!is_app_running || is_app_closing) + return; + QEvent event(QEvent::ApplicationPaletteChange); QGuiApplication::sendEvent(QGuiApplication::instance(), &event); } |