The QSysInfo class provides information about the system.
-
WordSize specifies the size of a pointer for the platform on which the application is compiled.
-
ByteOrder specifies whether the platform is big-endian or little-endian.
-
WindowsVersion specifies the version of the Windows operating system on which the application is run (Windows only)
-
MacintoshVersion specifies the version of the Macintosh operating system on which the application is run (Mac only).
Some constants are defined only on certain platforms. You can use the preprocessor symbols Q_OS_WIN and Q_OS_DARWIN to test that the application is compiled under Windows or Mac OS X.
- See also
- QLibraryInfo
This enum provides symbolic names for the various versions of the Windows operating system. On Windows the QSysInfo::WindowsVersion variable gives the version of the system on which the application is run.
Constant | Value | Description |
QSysInfo::WV_NT | 0x0010 | Windows NT (OS version 4.0) |
QSysInfo::WV_2000 | 0x0020 | Windows 2000 (OS version 5.0) |
QSysInfo::WV_XP | 0x0030 | Windows XP (OS version 5.1) |
QSysInfo::WV_2003 | 0x0040 | Windows Server 2003, Windows Server 2003 R2, Windows Home Server, Windows XP Professional x64 Edition (OS version 5.2) |
QSysInfo::WV_VISTA | 0x0080 | Windows Vista, Windows Server 2008 (OS version 6.0) |
QSysInfo::WV_WINDOWS7 | 0x0090 | Windows 7, Windows Server 2008 R2 (OS version 6.1) |
QSysInfo::WV_WINDOWS8 | 0x00a0 | Windows 8 (OS version 6.2) |
QSysInfo::WV_WINDOWS8_1 | 0x00b0 | Windows 8.1 (OS version 6.3) |
QSysInfo::WV_WINDOWS10 | 0x00b0 | Windows 10.0 (OS version 10.0) |
Alternatively, you may use the following macros which correspond directly to the Windows operating system version number:
Constant | Value | Description |
QSysInfo::WV_4_0 | WV_NT | Operating system version 4.0, corresponds to Windows NT |
QSysInfo::WV_5_0 | WV_2000 | Operating system version 5.0, corresponds to Windows 2000 |
QSysInfo::WV_5_1 | WV_XP | Operating system version 5.1, corresponds to Windows XP |
QSysInfo::WV_5_2 | WV_2003 | Operating system version 5.2, corresponds to Windows Server 2003, Windows Server 2003 R2, Windows Home Server, and Windows XP Professional x64 Edition |
QSysInfo::WV_6_0 | WV_VISTA | Operating system version 6.0, corresponds to Windows Vista and Windows Server 2008 |
QSysInfo::WV_6_1 | WV_WINDOWS7 | Operating system version 6.1, corresponds to Windows 7 and Windows Server 2008 R2 |
QSysInfo::WV_6_2 | WV_WINDOWS8 | Operating system version 6.2, corresponds to Windows 8 |
QSysInfo::WV_6_3 | WV_WINDOWS8_1 | Operating system version 6.3, corresponds to Windows 8.1 |
QSysInfo::WV_10_0 | WV_WINDOWS10 | Operating system version 10.0, corresponds to Windows 10.0 |
The following masks can be used for testing whether a Windows version is MS-DOS-based, NT-based, or CE-based:
- See also
- MacVersion