From 333a4ca7dd9eb9f4fccaef2725a50d6bf5638fc2 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 5 Oct 2024 19:38:44 +0200 Subject: [PATCH] Windows11Style: allow usage also on windows 10 There is no reason to limit the usage of the windows 11 style to win11 or above - it works perfectly on windows 10 when using the correct font. Change-Id: I179d2c017cdad130a134f45c2f0dfadc052a39f0 Reviewed-by: Wladimir Leuschner Reviewed-by: Oliver Wolff (cherry picked from commit c9306baa825c4070e37aa46aff00aa1905bf1681) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/styles/modernwindows/main.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/plugins/styles/modernwindows/main.cpp b/src/plugins/styles/modernwindows/main.cpp index a4d8e603858..18c751c1cb2 100644 --- a/src/plugins/styles/modernwindows/main.cpp +++ b/src/plugins/styles/modernwindows/main.cpp @@ -19,15 +19,10 @@ public: QStyle *QModernWindowsStylePlugin::create(const QString &key) { - bool isWin11OrAbove = QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows11; - if (isWin11OrAbove && key.compare(QLatin1String("windows11"), Qt::CaseInsensitive) == 0) { + if (key.compare(QLatin1String("windows11"), Qt::CaseInsensitive) == 0) return new QWindows11Style(); - } else if (!isWin11OrAbove && key.compare(QLatin1String("windows11"), Qt::CaseInsensitive) == 0) { - qWarning("QWindows11Style: Style is only supported on Windows11 and above"); + if (key.compare(QLatin1String("windowsvista"), Qt::CaseInsensitive) == 0) return new QWindowsVistaStyle(); - } else if (key.compare(QLatin1String("windowsvista"), Qt::CaseInsensitive) == 0) { - return new QWindowsVistaStyle(); - } return nullptr; }