QOperatingSystemVersion_win: Allow override as Windows 11

And added some later Windows Server versions.

Change-Id: I81415f1044d11458a4b4d19b01ce90e357f9d111
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Yuhang Zhao 2022-01-05 17:21:45 +08:00
parent 7cbac745dc
commit e8882ac896

View File

@ -87,13 +87,18 @@ OSVERSIONINFOEX qWindowsVersionInfo()
result.wServicePackMinor = 0;
const QByteArray winVerOverride = qgetenv("QT_WINVER_OVERRIDE");
if (winVerOverride == "WINDOWS10" || winVerOverride == "2016") {
if (winVerOverride == "WINDOWS10" || winVerOverride == "2016"
|| winVerOverride == "2019" || winVerOverride == "2022") {
result.dwMajorVersion = 10;
} else if (winVerOverride == "WINDOWS11") {
result.dwMajorVersion = 10;
result.dwBuildNumber = 22000;
} else {
return realResult;
}
if (winVerOverride == "2016") {
if (winVerOverride == "2016" || winVerOverride == "2019"
|| winVerOverride == "2022") {
// If the current host OS is a domain controller and the override OS
// is also a server type OS, preserve that information
if (result.wProductType == VER_NT_WORKSTATION)