SystemInfo Class

class QInstaller::SystemInfo

Provides information about the operating system. More...

Header: #include <SystemInfo>
Inherits: QObject


Public Functions

SystemInfo(QObject *parent = 0)
QString currentCpuArchitecture() const
QString kernelType() const
QString kernelVersion() const
QString prettyProductName() const
QString productType() const
QString productVersion() const

Detailed Description

Property Documentation

currentCpuArchitecture : const QString

The architecture of the CPU that the application is running on, in text format.

Possible values include:

  • "i386"
  • "x86_64"

Note: This function depends on what the OS will report and may not detect the actual CPU architecture if the OS hides that information or is unable to provide it. For example, a 32-bit OS running on a 64-bit CPU is usually unable to determine whether the CPU is actually capable of running 64-bit programs.

Access functions:

QString currentCpuArchitecture() const

See also QSysInfo::currentCpuArchitecture().

kernelType : const QString

The type of the operating system kernel the installer was compiled for. It is also the kernel the installer is running on, unless the host operating system is running a form of compatibility or virtualization layer.

For Windows, Linux, and macOS this will return:

  • "winnt"
  • "linux"
  • "darwin"

On Unix systems, it returns the same as the output of uname -s (lowercased).

Access functions:

QString kernelType() const

See also QSysInfo::kernelType().

kernelVersion : const QString

The release version of the operating system kernel. On Windows, it returns the version of the NT or CE kernel. On Unix systems, including macOS, it returns the same as the uname -r command would return.

Example values are:

  • "6.1.7601" for Windows 7 with Service Pack 1
  • "3.16.6-2-desktop" for openSUSE 13.2 kernel 3.16.6-2
  • "12.5.0" last release of OS X "Mountain Lion"

Access functions:

QString kernelVersion() const

See also QSysInfo::kernelVersion().

prettyProductName : const QString

A prettier form of SystemInfo::productType and SystemInfo::productVersion, containing other tokens like the operating system type, codenames and other information. The result of this function is suitable for displaying to the user.

Example values are:

  • "Windows 7"
  • "openSUSE 13.2 (Harlequin) (x86_64)"
  • "OS X Mountain Lion (10.8)"

Access functions:

QString prettyProductName() const

See also QSysInfo::prettyProductName().

productType : const QString

The product name of the operating system this application is running in.

Example values are:

  • "windows"
  • "opensuse" (for the Linux openSUSE distribution)
  • "osx"

Access functions:

QString productType() const

See also QSysInfo::productType().

productVersion : const QString

The product version of the operating system in string form. If the version could not be determined, this function returns "unknown".

Example values are:

  • "7" for Windows 7
  • "13.2" for openSUSE 13.2
  • "10.8" for OS X Mountain Lion

Access functions:

QString productVersion() const

See also QSysInfo::productVersion().

Member Function Documentation

SystemInfo::SystemInfo(QObject *parent = 0)

Creates a system info object with the parent parent.

© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. The Qt Company, Qt and their respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.