QOperatingSystemVersion: Add support for Win10 sub-versions

Windows 10 has many sub-versions such as 1809/1903/1909/etc,
currently Qt6 can only detect if the application is running
on Win10 or not, which I think is not accurate enough.
Different Win10 version may introduce different features
and bugs, the developers will have to know the exact version.
Only give a general Win10 as an answer is not ideal. I think
Qt should add variables for these sub-versions.

Change-Id: I772d25a528ee2f8a4afba314d701142a06c718f9
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Yuhang Zhao 2021-11-02 16:30:17 +08:00
parent c4856a9075
commit 9568362bfe
2 changed files with 63 additions and 0 deletions

View File

@ -407,6 +407,62 @@ const QOperatingSystemVersion QOperatingSystemVersion::Windows8_1 =
const QOperatingSystemVersion QOperatingSystemVersion::Windows10 =
QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10);
/*!
\variable QOperatingSystemVersion::Windows10_1809
\brief a version corresponding to Windows 10 1809 (version 10.0.17763).
\since 6.3
*/
const QOperatingSystemVersion QOperatingSystemVersion::Windows10_1809 =
QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10, 0, 17763);
/*!
\variable QOperatingSystemVersion::Windows10_1903
\brief a version corresponding to Windows 10 1903 (version 10.0.18362).
\since 6.3
*/
const QOperatingSystemVersion QOperatingSystemVersion::Windows10_1903 =
QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10, 0, 18362);
/*!
\variable QOperatingSystemVersion::Windows10_1909
\brief a version corresponding to Windows 10 1909 (version 10.0.18363).
\since 6.3
*/
const QOperatingSystemVersion QOperatingSystemVersion::Windows10_1909 =
QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10, 0, 18363);
/*!
\variable QOperatingSystemVersion::Windows10_2004
\brief a version corresponding to Windows 10 2004 (version 10.0.19041).
\since 6.3
*/
const QOperatingSystemVersion QOperatingSystemVersion::Windows10_2004 =
QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10, 0, 19041);
/*!
\variable QOperatingSystemVersion::Windows10_20H2
\brief a version corresponding to Windows 10 20H2 (version 10.0.19042).
\since 6.3
*/
const QOperatingSystemVersion QOperatingSystemVersion::Windows10_20H2 =
QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10, 0, 19042);
/*!
\variable QOperatingSystemVersion::Windows10_21H1
\brief a version corresponding to Windows 10 21H1 (version 10.0.19043).
\since 6.3
*/
const QOperatingSystemVersion QOperatingSystemVersion::Windows10_21H1 =
QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10, 0, 19043);
/*!
\variable QOperatingSystemVersion::Windows10_21H2
\brief a version corresponding to Windows 10 21H2 (version 10.0.19044).
\since 6.3
*/
const QOperatingSystemVersion QOperatingSystemVersion::Windows10_21H2 =
QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10, 0, 19044);
/*!
\variable QOperatingSystemVersion::OSXMavericks
\brief a version corresponding to OS X Mavericks (version 10.9).

View File

@ -64,6 +64,13 @@ public:
static const QOperatingSystemVersion Windows8;
static const QOperatingSystemVersion Windows8_1;
static const QOperatingSystemVersion Windows10;
static const QOperatingSystemVersion Windows10_1809; // RS5
static const QOperatingSystemVersion Windows10_1903; // 19H1
static const QOperatingSystemVersion Windows10_1909; // 19H2
static const QOperatingSystemVersion Windows10_2004; // 20H1
static const QOperatingSystemVersion Windows10_20H2; // 20H2
static const QOperatingSystemVersion Windows10_21H1; // 21H1
static const QOperatingSystemVersion Windows10_21H2; // 21H2
static const QOperatingSystemVersion OSXMavericks;
static const QOperatingSystemVersion OSXYosemite;