From 514a6cb7dcc6f40c2be16ebcd356aadb422c16fa Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Thu, 15 Dec 2022 13:50:54 +0800 Subject: Vista style: remove temporary workaround The MinGW issue has been fixed some time ago. Change-Id: Ie2eaa2952d398a913b06d36d7e621efff9e4c926 Reviewed-by: Qt CI Bot Reviewed-by: Volker Hilsheimer --- src/plugins/styles/windowsvista/qwindowsvistastyle.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/plugins/styles') diff --git a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp index d14f021c0e..fc612c82e5 100644 --- a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp +++ b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp @@ -68,14 +68,6 @@ HTHEME QWindowsVistaStylePrivate::m_themes[NThemes]; bool QWindowsVistaStylePrivate::useVistaTheme = false; Q_CONSTINIT QBasicAtomicInt QWindowsVistaStylePrivate::ref = Q_BASIC_ATOMIC_INITIALIZER(-1); // -1 based refcounting -namespace QOSWorkaround { - // Due to a mingw bug being confused by static constexpr variables in an exported class, - // we cannot use QOperatingSystemVersion::Windows11 in libraries outside of QtCore. - // ### TODO Remove this when that problem is fixed. - static constexpr QOperatingSystemVersionBase Windows11 { QOperatingSystemVersionBase::Windows, - 10, 0, 22000 }; -} - static void qt_add_rect(HRGN &winRegion, QRect r) { HRGN rgn = CreateRectRgn(r.left(), r.top(), r.x() + r.width(), r.y() + r.height()); @@ -2939,7 +2931,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption else theme.stateId = bullet ? MC_BULLETNORMAL: MC_CHECKMARKNORMAL; d->drawBackground(theme); - } else if (QOperatingSystemVersion::current() >= QOSWorkaround::Windows11 + } else if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows11 && !act) { painter->fillRect(checkRect, menuitem->palette.highlight().color().lighter(200)); } @@ -3024,7 +3016,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption partId, stateId, option->rect); d->drawBackground(theme); } - return; + return; case CE_MenuBarEmptyArea: { stateId = MBI_NORMAL; -- cgit v1.2.3