diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index c516c56bc78..3630537de26 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2807,7 +2807,7 @@ void QGuiApplicationPrivate::processSafeAreaMarginsChangedEvent(QWindowSystemInt QGuiApplication::sendSpontaneousEvent(wse->window, &event); } -void QGuiApplicationPrivate::processThemeChanged(QWindowSystemInterfacePrivate::ThemeChangeEvent *tce) +void QGuiApplicationPrivate::processThemeChanged(QWindowSystemInterfacePrivate::ThemeChangeEvent *) { if (self) self->handleThemeChanged(); @@ -2815,10 +2815,7 @@ void QGuiApplicationPrivate::processThemeChanged(QWindowSystemInterfacePrivate:: QIconPrivate::clearIconCache(); QEvent themeChangeEvent(QEvent::ThemeChange); - if (tce->window) - QGuiApplication::sendSpontaneousEvent(tce->window, &themeChangeEvent); - else - QGuiApplication::sendSpontaneousEvent(qGuiApp, &themeChangeEvent); + QGuiApplication::sendSpontaneousEvent(qGuiApp, &themeChangeEvent); } void QGuiApplicationPrivate::handleThemeChanged() diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index 97201770d8b..fa3e2f1d04f 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -828,9 +828,9 @@ void QWindowSystemInterface::handleScreenRefreshRateChange(QScreen *screen, qrea handleWindowSystemEvent(screen, newRefreshRate); } -QT_DEFINE_QPA_EVENT_HANDLER(void, handleThemeChange, QWindow *window) +QT_DEFINE_QPA_EVENT_HANDLER(void, handleThemeChange) { - handleWindowSystemEvent(window); + handleWindowSystemEvent(); } #if QT_CONFIG(draganddrop) diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h index b50afedf14c..d6783fca47f 100644 --- a/src/gui/kernel/qwindowsysteminterface.h +++ b/src/gui/kernel/qwindowsysteminterface.h @@ -199,7 +199,7 @@ public: static void handleScreenRefreshRateChange(QScreen *screen, qreal newRefreshRate); template - static void handleThemeChange(QWindow *window = nullptr); + static void handleThemeChange(); static void handleFileOpenEvent(const QString& fileName); static void handleFileOpenEvent(const QUrl &url); diff --git a/src/gui/kernel/qwindowsysteminterface_p.h b/src/gui/kernel/qwindowsysteminterface_p.h index cfc1604795e..2d2637dfa4f 100644 --- a/src/gui/kernel/qwindowsysteminterface_p.h +++ b/src/gui/kernel/qwindowsysteminterface_p.h @@ -329,9 +329,8 @@ public: class ThemeChangeEvent : public WindowSystemEvent { public: - explicit ThemeChangeEvent(QWindow * w) - : WindowSystemEvent(ThemeChange), window(w) { } - QPointer window; + explicit ThemeChangeEvent() + : WindowSystemEvent(ThemeChange) { } }; class ExposeEvent : public WindowSystemEvent {