CopperSpice API  1.7.2
QSysInfo Class Reference

The QSysInfo class provides information about the system. More...

enum  Endian

enum  MacVersion

enum  Sizes

enum  WinVersion

## Static Public Methods

static QString machineHostName ()

static QSysInfo::MacVersion macVersion ()

static WinVersion windowsVersion ()

## Static Public Members

static const MacVersion MacintoshVersion

static const WinVersion WindowsVersion

## Detailed Description

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_MAC to test that the application is compiled under Windows or Mac OS X.

QLibraryInfo

## Member Enumeration Documentation

 enum QSysInfo::Endian
ConstantValueDescription
QSysInfo::BigEndian0 Big-endian byte order (also called Network byte order)
QSysInfo::LittleEndian1 Little-endian byte order
QSysInfo::ByteOrderplatform-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 Mac OS X operating system. The QSysInfo::MacintoshVersion variable gives the version of the system on which the application is run.

ConstantValueDescription
QSysInfo::MV_10_110x000D OS X 10.11
QSysInfo::MV_10_120x000E OS X 10.12
QSysInfo::MV_10_130x000F OS X 10.13
QSysInfo::MV_10_140x0010 OS X 10.14
QSysInfo::MV_Unknown0x0000 An unknown and currently unsupported platform
QSysInfo::MV_ELCAPITANMV_10_11
QSysInfo::MV_SIERRAMV_10_12
QSysInfo::MV_HIGHSIERRAMV_10_13
QSysInfo::MV_MOJAVEMV_10_14
WinVersion
 enum QSysInfo::Sizes

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

ConstantValueDescription
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::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.

ConstantValueDescription
QSysInfo::WV_NT0x0010 Windows NT (OS version 4.0)
QSysInfo::WV_20000x0020 Windows 2000 (OS version 5.0)
QSysInfo::WV_XP0x0030 Windows XP (OS version 5.1)
QSysInfo::WV_20030x0040 Windows Server 2003, Windows Server 2003 R2, Windows Home Server, Windows XP Professional x64 Edition (OS version 5.2)
QSysInfo::WV_VISTA0x0080 Windows Vista, Windows Server 2008 (OS version 6.0)
QSysInfo::WV_WINDOWS70x0090 Windows 7, Windows Server 2008 R2 (OS version 6.1)
QSysInfo::WV_WINDOWS80x00a0 Windows 8 (OS version 6.2)
QSysInfo::WV_WINDOWS8_10x00b0 Windows 8.1 (OS version 6.3)
QSysInfo::WV_WINDOWS100x00b0 Windows 10.0 (OS version 10.0)

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

ConstantValueDescription
QSysInfo::WV_4_0WV_NT Operating system version 4.0, corresponds to Windows NT
QSysInfo::WV_5_0WV_2000 Operating system version 5.0, corresponds to Windows 2000
QSysInfo::WV_5_1WV_XP Operating system version 5.1, corresponds to Windows XP
QSysInfo::WV_5_2WV_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_0WV_VISTA Operating system version 6.0, corresponds to Windows Vista and Windows Server 2008
QSysInfo::WV_6_1WV_WINDOWS7 Operating system version 6.1, corresponds to Windows 7 and Windows Server 2008 R2
QSysInfo::WV_6_2WV_WINDOWS8 Operating system version 6.2, corresponds to Windows 8
QSysInfo::WV_6_3WV_WINDOWS8_1 Operating system version 6.3, corresponds to Windows 8.1
QSysInfo::WV_10_0WV_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:

MacVersion

## Method Documentation

 QString QSysInfo::machineHostName ( )
static

Returns this machine's host name, if one is configured. Hostnames are not guaranteed to be globally unique, especially if they were configured automatically.

This method does not guarantee the returned host name is a Fully Qualified Domain Name (FQDN). For that, use QHostInfo to resolve the returned name to an FQDN. This method returns the same as QHostInfo::localHostName().

QHostInfo::localDomainName
 QSysInfo::MacVersion QSysInfo::macVersion ( )
static

Returns the version of Mac OS X on which the application is run. Returns MV_None if the operating system is not a version of Darwin.

 WinVersion QSysInfo::windowsVersion ( )
static

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

## Member Data Documentation

 const MacVersion QSysInfo::MacintoshVersion
static

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

 const WinVersion QSysInfo::WindowsVersion
static

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