diff options
author | Tor Arne Vestbø <[email protected]> | 2025-04-09 10:54:49 +0200 |
---|---|---|
committer | Tor Arne Vestbø <[email protected]> | 2025-04-15 17:31:29 +0200 |
commit | 68a9c5fe513e147e4cffd29b50a4714813df411e (patch) | |
tree | 38408e92c9d88ed56e71e905b48136d325a136b8 | |
parent | fdfed82675f852f108e0224a50d58a8b38d67a1a (diff) |
Remove QWindow argument from QWindowSystemInterface::handleThemeChange
The QPlatformTheme, and consumers on top such as QStyleHints, are app
global, so it doesn't make sense to notify that a single window has
changed its theme.
None of the QPA plugins pass a QWindow to the function today, after
the Windows plugin was taught a few new tricks in a preceding change.
[ChangeLog][QPA] QWindowSystemInterface::handleThemeChange no longer
takes an optional QWindow.
Change-Id: Ia761c95559a56a00763bd3cb95332f377e8de483
Reviewed-by: Volker Hilsheimer <[email protected]>
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 7 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 4 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface_p.h | 5 |
4 files changed, 7 insertions, 11 deletions
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<QWindowSystemInterfacePrivate::ScreenRefreshRateEvent>(screen, newRefreshRate); } -QT_DEFINE_QPA_EVENT_HANDLER(void, handleThemeChange, QWindow *window) +QT_DEFINE_QPA_EVENT_HANDLER(void, handleThemeChange) { - handleWindowSystemEvent<QWindowSystemInterfacePrivate::ThemeChangeEvent, Delivery>(window); + handleWindowSystemEvent<QWindowSystemInterfacePrivate::ThemeChangeEvent, Delivery>(); } #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<typename Delivery = QWindowSystemInterface::DefaultDelivery> - 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<QWindow> window; + explicit ThemeChangeEvent() + : WindowSystemEvent(ThemeChange) { } }; class ExposeEvent : public WindowSystemEvent { |