diff options
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 8f4c674952..4a0febc615 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -3755,7 +3755,7 @@ Qt::LayoutDirection QGuiApplication::layoutDirection() Returns the active application override cursor. - This function returns 0 if no application cursor has been defined (i.e. the + This function returns \nullptr if no application cursor has been defined (i.e. the internal cursor stack is empty). \sa setOverrideCursor(), restoreOverrideCursor() @@ -3991,6 +3991,9 @@ void QGuiApplicationPrivate::notifyThemeChanged() !QCoreApplication::testAttribute(Qt::AA_SetPalette)) { clearPalette(); initPalette(); + emit qGuiApp->paletteChanged(*app_pal); + if (is_app_running && !is_app_closing) + sendApplicationPaletteChange(); } if (!(applicationResourceFlags & ApplicationFontExplicitlySet)) { QMutexLocker locker(&applicationFontMutex); @@ -3999,6 +4002,15 @@ void QGuiApplicationPrivate::notifyThemeChanged() } } +void QGuiApplicationPrivate::sendApplicationPaletteChange(bool toAllWidgets, const char *className) +{ + Q_UNUSED(toAllWidgets) + Q_UNUSED(className) + + QEvent event(QEvent::ApplicationPaletteChange); + QGuiApplication::sendEvent(QGuiApplication::instance(), &event); +} + #if QT_CONFIG(draganddrop) void QGuiApplicationPrivate::notifyDragStarted(const QDrag *drag) { |