diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2024-04-30 14:06:57 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2024-05-02 19:03:42 +0200 |
commit | 8bc80f2e1a3b509837bef17c87d2df23b046623e (patch) | |
tree | 902594fa03979dd9683768f0cae539c5543e3866 /src/gui | |
parent | e176dd78fd2f253eb2625585b2bd90b5713e5984 (diff) |
Remove QGuiApplicationPrivate::colorScheme()
Use the platform theme or QStyleHints instead.
Task-number: QTBUG-124490
Change-Id: Iab12faa726d3031d6a250664468dac333c2c2e0c
Reviewed-by: Doris Verria <doris.verria@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 16 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication_p.h | 2 |
2 files changed, 3 insertions, 15 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 1d7cd37f67..6602411798 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2643,7 +2643,9 @@ void QGuiApplicationPrivate::processThemeChanged(QWindowSystemInterfacePrivate:: QIconPrivate::clearIconCache(); - QStyleHintsPrivate::get(QGuiApplication::styleHints())->updateColorScheme(colorScheme()); + const auto newColorScheme = platformTheme() ? platformTheme()->colorScheme() + : Qt::ColorScheme::Unknown; + QStyleHintsPrivate::get(QGuiApplication::styleHints())->updateColorScheme(newColorScheme); QEvent themeChangeEvent(QEvent::ThemeChange); const QWindowList windows = tce->window ? QWindowList{tce->window} : window_list; @@ -2651,18 +2653,6 @@ void QGuiApplicationPrivate::processThemeChanged(QWindowSystemInterfacePrivate:: QGuiApplication::sendSpontaneousEvent(window, &themeChangeEvent); } -/*! - \internal - \brief QGuiApplicationPrivate::colorScheme - \return the platform theme's color scheme - or Qt::ColorScheme::Unknown if a platform theme cannot be established - */ -Qt::ColorScheme QGuiApplicationPrivate::colorScheme() -{ - return platformTheme() ? platformTheme()->colorScheme() - : Qt::ColorScheme::Unknown; -} - void QGuiApplicationPrivate::handleThemeChanged() { updatePalette(); diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index 2bfcd87f3f..cca79534fc 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -323,8 +323,6 @@ public: static void updatePalette(); - static Qt::ColorScheme colorScheme(); - protected: virtual void handleThemeChanged(); |