QSysInfo 类

The QSysInfo class provides information about the system. 更多...

头: #include <QSysInfo>

公共类型

enum Endian { BigEndian, LittleEndian, ByteOrder }
enum MacVersion { MV_9, MV_10_0, MV_10_1, MV_10_2, ..., MV_YOSEMITE }
enum S60Version { SV_S60_3_1, SV_S60_3_2, SV_S60_5_0, SV_S60_5_1, ..., SV_S60_Unknown }
enum Sizes { WordSize }
enum SymbianVersion { SV_9_2, SV_9_3, SV_9_4, SV_SF_1, ..., SV_Unknown }
enum WinVersion { WV_32s, WV_95, WV_98, WV_Me, ..., WV_CE_based }

静态公共成员

const MacVersion MacintoshVersion
const WinVersion WindowsVersion
S60Version s60Version ()
SymbianVersion symbianVersion ()
WinVersion windowsVersion ()

详细描述

The QSysInfo class provides information about the system.

  • WordSize 指定用于在其中编译应用程序的平台指针大小。
  • ByteOrder 指定平台是大端在前还是小端在前。
  • 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_WS_WIN and Q_WS_MAC to test that the application is compiled under Windows or Mac.

另请参阅 QLibraryInfo .

成员类型文档编制

enum QSysInfo:: Endian

常量 描述
QSysInfo::BigEndian 0 Big-endian byte order (also called Network byte order)
QSysInfo::LittleEndian 1 小端在前字节序
QSysInfo::ByteOrder <platform-dependent> Equals BigEndian or LittleEndian, depending on the platform's byte order.

enum QSysInfo:: MacVersion

This enum provides symbolic names for the various versions of the OS X operating system. On OS X, the QSysInfo::MacintoshVersion variable gives the version of the system on which the application is run.

常量 描述
QSysInfo::MV_9 0x0001 Mac OS 9 (unsupported)
QSysInfo::MV_10_0 0x0002 Mac OS X 10.0 (unsupported)
QSysInfo::MV_10_1 0x0003 Mac OS X 10.1 (unsupported)
QSysInfo::MV_10_2 0x0004 Mac OS X 10.2 (unsupported)
QSysInfo::MV_10_3 0x0005 Mac OS X 10.3
QSysInfo::MV_10_4 0x0006 Mac OS X 10.4
QSysInfo::MV_10_5 0x0007 Mac OS X 10.5
QSysInfo::MV_10_6 0x0008 Mac OS X 10.6
QSysInfo::MV_10_7 0x0009 OS X 10.7
QSysInfo::MV_10_8 0x000A OS X 10.8
QSysInfo::MV_10_9 0x000B OS X 10.9
QSysInfo::MV_10_10 0x000C OS X 10.10
QSysInfo::MV_Unknown 0x0000 An unknown and currently unsupported platform
QSysInfo::MV_CHEETAH MV_10_0 Apple codename for MV_10_0
QSysInfo::MV_PUMA MV_10_1 Apple codename for MV_10_1
QSysInfo::MV_JAGUAR MV_10_2 Apple codename for MV_10_2
QSysInfo::MV_PANTHER MV_10_3 Apple codename for MV_10_3
QSysInfo::MV_TIGER MV_10_4 Apple codename for MV_10_4
QSysInfo::MV_LEOPARD MV_10_5 Apple codename for MV_10_5
QSysInfo::MV_SNOWLEOPARD MV_10_6 Apple codename for MV_10_6
QSysInfo::MV_LION MV_10_7 Apple codename for MV_10_7
QSysInfo::MV_MOUNTAINLION MV_10_8 Apple codename for MV_10_8
QSysInfo::MV_MAVERICKS MV_10_9 Apple codename for MV_10_9
QSysInfo::MV_YOSEMITE MV_10_10 Apple codename for MV_10_10

另请参阅 WinVersion and SymbianVersion .

enum QSysInfo:: S60Version

This enum provides symbolic names for the various versions of the S60 SDK. On S60, the QSysInfo::s60Version () function gives the version of the SDK on which the application is run.

常量 描述
QSysInfo::SV_S60_3_1 SV_9_2 S60 3rd Edition Feature Pack 1
QSysInfo::SV_S60_3_2 SV_9_3 S60 3rd Edition Feature Pack 2
QSysInfo::SV_S60_5_0 SV_9_4 S60 5th Edition
QSysInfo::SV_S60_5_1 SV_SF_2 此枚举值被弃用。
QSysInfo::SV_S60_5_2 SV_SF_3 Symbian^3 and Symbian Anna
QSysInfo::SV_S60_5_3 SV_API_5_3 Symbian/S60 API version 5.3 release
QSysInfo::SV_S60_5_4 SV_API_5_4 Symbian/S60 API version 5.4 release
QSysInfo::SV_S60_5_5 SV_API_5_5 Symbian/S60 API version 5.5 release
QSysInfo::SV_S60_Unknown SV_Unknown An unknown and currently unsupported platform

另请参阅 SymbianVersion , WinVersion ,和 MacVersion .

enum QSysInfo:: Sizes

This enum provides platform-specific information about the sizes of data structures used by the underlying architecture.

常量 描述
QSysInfo::WordSize ( sizeof( void * ) <<3 ) The size in bits of a pointer for the platform on which the application is compiled (32 or 64).

enum QSysInfo:: SymbianVersion

This enum provides symbolic names for the various versions of the Symbian operating system. On Symbian, the QSysInfo::symbianVersion () function gives the version of the system on which the application is run.

常量 描述
QSysInfo::SV_9_2 10 Symbian OS v9.2
QSysInfo::SV_9_3 20 Symbian OS v9.3
QSysInfo::SV_9_4 30 Symbian OS v9.4
QSysInfo::SV_SF_1 SV_9_4 S60 5th Edition (Symbian^1)
QSysInfo::SV_SF_2 40 Symbian^2
QSysInfo::SV_SF_3 50 Symbian^3 or Symbian Anna
QSysInfo::SV_SF_4 60 此枚举值被弃用。
QSysInfo::SV_API_5_3 70 Symbian/S60 API version 5.3 release
QSysInfo::SV_API_5_4 80 Symbian/S60 API version 5.4 release
QSysInfo::SV_API_5_5 90 Symbian/S60 API version 5.5 release
QSysInfo::SV_Unknown 1000000 An unknown and currently unsupported platform

另请参阅 S60Version , WinVersion ,和 MacVersion .

enum QSysInfo:: WinVersion

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.

MS-DOS-based versions:

常量 描述
QSysInfo::WV_32s 0x0001 Windows 3.1 with Win 32s
QSysInfo::WV_95 0x0002 Windows 95
QSysInfo::WV_98 0x0003 Windows 98
QSysInfo::WV_Me 0x0004 Windows Me

NT-based versions (note that each operating system version is only represented once rather than each Windows edition):

常量 描述
QSysInfo::WV_NT 0x0010 Windows NT (operating system version 4.0)
QSysInfo::WV_2000 0x0020 Windows 2000 (operating system version 5.0)
QSysInfo::WV_XP 0x0030 Windows XP (operating system version 5.1)
QSysInfo::WV_2003 0x0040 Windows Server 2003, Windows Server 2003 R2, Windows Home Server, Windows XP Professional x64 Edition (operating system version 5.2)
QSysInfo::WV_VISTA 0x0080 Windows Vista, Windows Server 2008 (operating system version 6.0)
QSysInfo::WV_WINDOWS7 0x0090 Windows 7, Windows Server 2008 R2 (operating system version 6.1)
QSysInfo::WV_WINDOWS8 0x00a0 Windows 8 (operating system version 6.2)
QSysInfo::WV_WINDOWS8_1 0x00b0 Windows 8.1 (operating system version 6.3), introduced in Qt 4.8.6
QSysInfo::WV_WINDOWS10 0x00c0 Windows 10 (operating system version 10.0), introduced in Qt 4.8.7

Alternatively, you may use the following macros which correspond directly to the Windows operating system version number:

常量 描述
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, introduced in Qt 4.8.6
QSysInfo::WV_10_0 WV_WINDOWS10 Operating system version 10.0, corresponds to Windows 10, introduced in Qt 4.8.7

CE-based versions:

常量 描述
QSysInfo::WV_CE 0x0100 Windows CE
QSysInfo::WV_CENET 0x0200 Windows CE .NET
QSysInfo::WV_CE_5 0x0300 Windows CE 5.x
QSysInfo::WV_CE_6 0x0400 Windows CE 6.x

The following masks can be used for testing whether a Windows version is MS-DOS-based, NT-based, or CE-based:

常量 描述
QSysInfo::WV_DOS_based 0x000f MS-DOS-based version of Windows
QSysInfo::WV_NT_based 0x00f0 NT-based version of Windows
QSysInfo::WV_CE_based 0x0f00 CE-based version of Windows

另请参阅 MacVersion and SymbianVersion .

成员函数文档编制

[static] S60Version QSysInfo:: s60Version ()

Returns the version of the S60 SDK system on which the application is run (S60 only).

该函数在 Qt 4.6 引入。

[static] SymbianVersion QSysInfo:: symbianVersion ()

Returns the version of the Symbian operating system on which the application is run (Symbian only).

该函数在 Qt 4.6 引入。

[static] WinVersion QSysInfo:: windowsVersion ()

Returns the version of the Windows operating system on which the application is run (Windows only).

该函数在 Qt 4.4 引入。

成员变量文档编制

const MacVersion QSysInfo:: MacintoshVersion

This variable holds the version of the Macintosh operating system on which the application is run (Mac only).

const WinVersion QSysInfo:: WindowsVersion

This variable holds the version of the Windows operating system on which the application is run (Windows only).