OpenGL: add support for Win11 detection
The current code can't distinguish between Windows 10 and Windows 11, this patch fixes that. Change-Id: I8269f0544c09205ae9845b7981f4a86c664bee09 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>bb10
parent
365904085e
commit
48a5d94fd6
|
|
@ -195,20 +195,13 @@ struct OsTypeTerm
|
|||
static QString hostOs();
|
||||
static QVersionNumber hostKernelVersion() { return QVersionNumber::fromString(QSysInfo::kernelVersion()); }
|
||||
static QString hostOsRelease() {
|
||||
QString ver;
|
||||
#ifdef Q_OS_WIN
|
||||
const auto osver = QOperatingSystemVersion::current();
|
||||
#define Q_WINVER(major, minor) (major << 8 | minor)
|
||||
switch (Q_WINVER(osver.majorVersion(), osver.minorVersion())) {
|
||||
case Q_WINVER(10, 0):
|
||||
ver = QStringLiteral("10");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#undef Q_WINVER
|
||||
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows11)
|
||||
return u"11"_s;
|
||||
return u"10"_s;
|
||||
#else
|
||||
return {};
|
||||
#endif
|
||||
return ver;
|
||||
}
|
||||
|
||||
bool isNull() const { return type.isEmpty(); }
|
||||
|
|
|
|||
Loading…
Reference in New Issue