From 730c6d3de564c63bfd07213c68cd2574fe9e5122 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 26 Apr 2024 12:30:23 +0300 Subject: [PATCH] Fix for issue QTBUG-123722 introduced in Qt 6.7.0. --- src/libs/vmisc/theme/vtheme.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/libs/vmisc/theme/vtheme.cpp b/src/libs/vmisc/theme/vtheme.cpp index d8babac56..a90cf76ba 100644 --- a/src/libs/vmisc/theme/vtheme.cpp +++ b/src/libs/vmisc/theme/vtheme.cpp @@ -135,7 +135,16 @@ void ActivateCustomDarkTheme() void ActivateDefaultThemeWin() { #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) +// Fix for issue QTBUG-123722 +#if QT_VERSION == QT_VERSION_CHECK(6, 7, 0) + if (!VTheme::IsInDarkTheme()) + { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast) + qApp->setStyleSheet(QStringLiteral("QComboBox QAbstractItemView {background-color: white}")); + } +#else qApp->setStyleSheet(QString()); // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast) +#endif #else if (VTheme::IsInDarkTheme()) { @@ -357,7 +366,16 @@ void VTheme::SetIconTheme() //--------------------------------------------------------------------------------------------------------------------- void VTheme::SetToAutoTheme() const { +// Fix for issue QTBUG-123722 +#if defined(Q_OS_WIN) && QT_VERSION == QT_VERSION_CHECK(6, 7, 0) + if (!IsInDarkTheme()) + { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast) + qApp->setStyleSheet(QStringLiteral("QComboBox QAbstractItemView {background-color: white}")); + } +#else qApp->setStyleSheet(QString()); // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast) +#endif QIcon::setThemeName(m_defaultThemeName); }