ColorScheme: remove unused QWindowsApplication::isDarkMode

It unnecessarily duplicates and distributes logic for reporting whether
the application should run in dark or light mode.

Task-number: QTBUG-124490
Change-Id: I227660cf3e1f21afd5fd9b3d6452f6109f3cf799
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
This commit is contained in:
Volker Hilsheimer 2024-04-19 13:56:34 +02:00
parent d3b0d414b0
commit bce9d648c2
4 changed files with 1 additions and 17 deletions

View File

@ -403,8 +403,6 @@ struct Q_GUI_EXPORT QWindowsApplication
virtual bool isWinTabEnabled() const = 0;
virtual bool setWinTabEnabled(bool enabled) = 0;
virtual bool isDarkMode() const = 0;
virtual DarkModeHandling darkModeHandling() const = 0;
virtual void setDarkModeHandling(DarkModeHandling handling) = 0;

View File

@ -181,15 +181,7 @@ QT_DEFINE_NATIVE_INTERFACE(QWindowsScreen);
\value DarkModeStyle The Windows Vista style will be turned off and
a simple dark style will be used.
\sa isDarkMode(), setDarkModeHandling()
*/
/*!
\fn bool QNativeInterface::Private::QWindowsApplication::isDarkMode() const = 0
\internal
Returns \c true if Windows 10 is configured to use dark mode for
applications.
\sa setDarkModeHandling()
*/
/*!

View File

@ -72,11 +72,6 @@ bool QWindowsApplication::setWinTabEnabled(bool enabled)
return enabled ? ctx->initTablet() : ctx->disposeTablet();
}
bool QWindowsApplication::isDarkMode() const
{
return QWindowsTheme::instance()->colorScheme() == Qt::ColorScheme::Dark;
}
QWindowsApplication::DarkModeHandling QWindowsApplication::darkModeHandling() const
{
return m_darkModeHandling;

View File

@ -24,7 +24,6 @@ public:
bool isWinTabEnabled() const override;
bool setWinTabEnabled(bool enabled) override;
bool isDarkMode() const override;
DarkModeHandling darkModeHandling() const override;
void setDarkModeHandling(DarkModeHandling handling) override;