CopperSpice API  1.9.1
QSysInfo Class Reference

QSysInfo provides information about the computer where the application is running. More...

Public Types

enum  Endian
 
enum  MacVersion
 
enum  Sizes
 
enum  WinVersion
 

Static Public Methods

static QString macEdition (MacVersion macVersion)
 
static QString machineHostName ()
 
static QSysInfo::MacVersion macVersion ()
 
static QString windowsEdition (WinVersion winVersion)
 
static WinVersion windowsVersion ()
 

Static Public Members

static const MacVersion MacintoshVersion
 
static const WinVersion WindowsVersion
 

Detailed Description

The QSysInfo class provides operating system information about the computer where the application is running.

This class contains values which are only defined on specific platforms. The preprocessor symbols Q_OS_WIN and Q_OS_DARWIN can be used to test if the application was compiled for a operating system running Windows or Mac OS X.

Sizes::WordSize
Enum value which specifies the size of a pointer for the platform on which the application is compiled
Endian::ByteOrder
Enum value which specifies whether the platform is big-endian or little-endian
WindowsVersion
Class variable indicating the version of the Windows operating system which the application is running on (Windows only)
MacintoshVersion
Class variable indicating the version of the Mac OS X operating system which the application is running on (Mac OS X only)
See also
QLibraryInfo

Member Enumeration Documentation

This enum can be used to determine the byte order of memory on the target system.

ConstantValueDescription
QSysInfo::BigEndian0 Big-endian byte order (also called Network byte order)
QSysInfo::LittleEndian1 Little-endian byte order
QSysInfo::ByteOrder0 or 1 Equal to BigEndian or LittleEndian, depends on the CPU byte order

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 running.

ConstantValueDescription
QSysInfo::MV_Unknown0x0000 Unknown platform
QSysInfo::MV_10_110x0001 OS X 10.11
QSysInfo::MV_10_120x0002 OS X 10.12
QSysInfo::MV_10_130x0003 OS X 10.13
QSysInfo::MV_10_140x0004 OS X 10.14
QSysInfo::MV_10_150x0005 OS X 10.15
QSysInfo::MV_10_160x0006 OS X 10.16
QSysInfo::MV_110x0006 OS X 11
QSysInfo::MV_120x0007 OS X 12
QSysInfo::MV_130x0008 OS X 13
QSysInfo::MV_140x0009 OS X 14
QSysInfo::MV_ELCAPITANMV_10_11 OS X 10.11
QSysInfo::MV_SIERRAMV_10_12 OS X 10.12
QSysInfo::MV_HIGHSIERRAMV_10_13 OS X 10.13
QSysInfo::MV_MOJAVEMV_10_14 OS X 10.14
QSysInfo::MV_CATALINAMV_10_15 OS X 10.15
QSysInfo::MV_BIGSURMV_11 OS X 11
QSysInfo::MV_MONTEREYMV_12 OS X 12
QSysInfo::MV_VENTURAMV_13 OS X 13
QSysInfo::MV_SONOMAMV_14 OS X 14

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

ConstantValueDescription
QSysInfo::WordSize sizeof(void *) * 8 Size in bits of a pointer for the platform on which the application is compiled (32 or 64).

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 running.

ConstantValueDescription
QSysInfo::WV_NT0x0010 Windows NT
QSysInfo::WV_20000x0020 Windows 2000
QSysInfo::WV_XP0x0030 Windows XP
QSysInfo::WV_20030x0040 Windows Server 2003, Windows Server 2003 R2, Home Server
QSysInfo::WV_VISTA0x0080 Windows Vista, Windows Server 2008
QSysInfo::WV_WINDOWS70x0090 Windows 7, Windows Server 2008 R2
QSysInfo::WV_WINDOWS80x00a0 Windows 8
QSysInfo::WV_WINDOWS8_10x00b0 Windows 8.1
QSysInfo::WV_WINDOWS100x00c0 Windows 10.0
QSysInfo::WV_WINDOWS110x00d0 Windows 11.0

Alternatively use the following macros which correspond directly to the Windows operating system version number.

ConstantValueDescription
QSysInfo::WV_4_0WV_NT Corresponds to Windows NT
QSysInfo::WV_5_0WV_2000 Corresponds to Windows 2000
QSysInfo::WV_5_1WV_XP Corresponds to Windows XP
QSysInfo::WV_5_2WV_2003 Corresponds to Windows Server 2003, Windows Server 2003 R2, Home Server
QSysInfo::WV_6_0WV_VISTA Corresponds to Windows Vista, Windows Server 2008
QSysInfo::WV_6_1WV_WINDOWS7 Corresponds to Windows 7, Windows Server 2008 R2
QSysInfo::WV_6_2WV_WINDOWS8 Corresponds to Windows 8
QSysInfo::WV_6_3WV_WINDOWS8_1 Corresponds to Windows 8.1
QSysInfo::WV_10_0WV_WINDOWS10 Corresponds to Windows 10.0
QSysInfo::WV_11_0WV_WINDOWS11 Corresponds to Windows 11.0

Method Documentation

QString QSysInfo::macEdition ( MacVersion  macVersion)
static

Returns the name of the Mac OS X operating system which corresponds to the macVersion (Mac OS X only).

QString QSysInfo::machineHostName ( )
static

Returns the host name for the computer where the application is running. The host name is not guaranteed to be globally unique, especially if they were configured automatically. Equivalent to calling QHostInfo::localHostName().

This method does not guarantee the returned host name is a Fully Qualified Domain Name (FQDN). If this is required use QHostInfo to resolve the FQDN.

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

Returns the version of Mac OS X on which the application is running. Returns MV_None if the operating system is not a version of Darwin (Mac OS X only).

QString QSysInfo::windowsEdition ( WinVersion  winVersion)
static

Returns the name of the Windows operating system which corresponds to the winVersion (Windows only).

WinVersion QSysInfo::windowsVersion ( )
static

Returns the version of the Windows operating system on which the application is running (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 running (Mac OS X only).

const WinVersion QSysInfo::WindowsVersion
static

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