Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmlsysteminformation.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
6#include <QtCore/qsysinfo.h>
7
9
10/*!
11 \qmltype SystemInformation
12 \inherits QtObject
13 \inqmlmodule QtCore
14 \since 6.4
15 \brief Provides information about the system.
16
17 The SystemInformation singleton type provides information about the system,
18 using a similar API to \l QSysInfo, where each function in QSysInfo is
19 available as a property:
20
21 \qml
22 if (SystemInformation.wordSize === 64) {
23 console.log("64 bit")
24 } else {
25 console.log("32 bit")
26 }
27
28 if (SystemInformation.byteOrder === SystemInformation.Little) {
29 console.log("Little endian")
30 } else {
31 console.log("Big endian")
32 }
33
34 console.log("Currently running on " + SystemInformation.prettyProductName)
35 \endqml
36
37 \sa QSysInfo
38*/
39
40QQmlSystemInformation::QQmlSystemInformation(QObject *parent) : QObject(parent)
41{
42}
43
44int QQmlSystemInformation::wordSize() const
45{
46 return QSysInfo::WordSize;
47}
48
49QQmlSystemInformation::Endian QQmlSystemInformation::byteOrder() const
50{
51 return static_cast<Endian>(QSysInfo::ByteOrder);
52}
53
54QString QQmlSystemInformation::buildCpuArchitecture() const
55{
56 return QSysInfo::buildCpuArchitecture();
57}
58
59QString QQmlSystemInformation::currentCpuArchitecture() const
60{
61 return QSysInfo::currentCpuArchitecture();
62}
63
64QString QQmlSystemInformation::buildAbi() const
65{
66 return QSysInfo::buildAbi();
67}
68
69QString QQmlSystemInformation::kernelType() const
70{
71 return QSysInfo::kernelType();
72}
73
74QString QQmlSystemInformation::kernelVersion() const
75{
76 return QSysInfo::kernelVersion();
77}
78
79QString QQmlSystemInformation::productType() const
80{
81 return QSysInfo::productType();
82}
83
84QString QQmlSystemInformation::productVersion() const
85{
86 return QSysInfo::productVersion();
87}
88
89QString QQmlSystemInformation::prettyProductName() const
90{
91 return QSysInfo::prettyProductName();
92}
93
94QString QQmlSystemInformation::machineHostName() const
95{
96 return QSysInfo::machineHostName();
97}
98
99QByteArray QQmlSystemInformation::machineUniqueId() const
100{
101 return QSysInfo::machineUniqueId();
102}
103
104QByteArray QQmlSystemInformation::bootUniqueId() const
105{
106 return QSysInfo::bootUniqueId();
107}
108
109QT_END_NAMESPACE
110
111#include "moc_qqmlsysteminformation_p.cpp"