diff options
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 30 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication_p.h | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 4 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication_p.h | 2 |
4 files changed, 19 insertions, 19 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 8c9bb75844..2ccaf2565b 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2585,13 +2585,27 @@ void QGuiApplicationPrivate::processSafeAreaMarginsChangedEvent(QWindowSystemInt void QGuiApplicationPrivate::processThemeChanged(QWindowSystemInterfacePrivate::ThemeChangeEvent *tce) { if (self) - self->notifyThemeChanged(); + self->handleThemeChanged(); if (QWindow *window = tce->window.data()) { QEvent e(QEvent::ThemeChange); QGuiApplication::sendSpontaneousEvent(window, &e); } } +void QGuiApplicationPrivate::handleThemeChanged() +{ + updatePalette(); + + QAbstractFileIconProviderPrivate::clearIconTypeCache(); + + if (!(applicationResourceFlags & ApplicationFontExplicitlySet)) { + const auto locker = qt_scoped_lock(applicationFontMutex); + clearFontUnlocked(); + initFontUnlocked(); + } + initThemeHints(); +} + void QGuiApplicationPrivate::processGeometryChangeEvent(QWindowSystemInterfacePrivate::GeometryChangeEvent *e) { if (e->window.isNull()) @@ -4198,20 +4212,6 @@ QPoint QGuiApplicationPrivate::QLastCursorPosition::toPoint() const noexcept return thePoint.toPoint(); } -void QGuiApplicationPrivate::notifyThemeChanged() -{ - updatePalette(); - - QAbstractFileIconProviderPrivate::clearIconTypeCache(); - - if (!(applicationResourceFlags & ApplicationFontExplicitlySet)) { - const auto locker = qt_scoped_lock(applicationFontMutex); - clearFontUnlocked(); - initFontUnlocked(); - } - initThemeHints(); -} - #if QT_CONFIG(draganddrop) void QGuiApplicationPrivate::notifyDragStarted(const QDrag *drag) { diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index 21d7af81b8..fbd7cac625 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -331,7 +331,7 @@ public: static void updatePalette(); protected: - virtual void notifyThemeChanged(); + virtual void handleThemeChanged(); static bool setPalette(const QPalette &palette); virtual QPalette basePalette() const; diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 6627f99f16..91c08de41f 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -4045,9 +4045,9 @@ void QApplicationPrivate::translateTouchCancel(const QPointingDevice *device, ul } } -void QApplicationPrivate::notifyThemeChanged() +void QApplicationPrivate::handleThemeChanged() { - QGuiApplicationPrivate::notifyThemeChanged(); + QGuiApplicationPrivate::handleThemeChanged(); qt_init_tooltip_palette(); } diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 0f86269332..5afa336afb 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -165,7 +165,7 @@ public: static QStyle *app_style; protected: - void notifyThemeChanged() override; + void handleThemeChanged() override; QPalette basePalette() const override; void handlePaletteChanged(const char *className = nullptr) override; |