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
4#ifndef QQMLSYSTEMINFORMATION_P_H
5#define QQMLSYSTEMINFORMATION_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qobject.h>
19#include <QtQmlCore/private/qqmlcoreglobal_p.h>
20#include <QtQml/qqmlregistration.h>
21
22QT_BEGIN_NAMESPACE
23class Q_QMLCORE_PRIVATE_EXPORT QQmlSystemInformation : public QObject
24{
25 Q_OBJECT
26 QML_SINGLETON
27 QML_NAMED_ELEMENT(SystemInformation)
28 QML_ADDED_IN_VERSION(6, 4)
29
30 Q_PROPERTY(int wordSize READ wordSize CONSTANT FINAL)
31 Q_PROPERTY(QQmlSystemInformation::Endian byteOrder READ byteOrder CONSTANT FINAL)
32 Q_PROPERTY(QString buildCpuArchitecture READ buildCpuArchitecture CONSTANT FINAL)
33 Q_PROPERTY(QString currentCpuArchitecture READ currentCpuArchitecture CONSTANT FINAL)
34 Q_PROPERTY(QString buildAbi READ buildAbi CONSTANT FINAL)
35 Q_PROPERTY(QString kernelType READ kernelType CONSTANT FINAL)
36 Q_PROPERTY(QString kernelVersion READ kernelVersion CONSTANT FINAL)
37 Q_PROPERTY(QString productType READ productType CONSTANT FINAL)
38 Q_PROPERTY(QString productVersion READ productVersion CONSTANT FINAL)
39 Q_PROPERTY(QString prettyProductName READ prettyProductName CONSTANT FINAL)
40 Q_PROPERTY(QString machineHostName READ machineHostName CONSTANT FINAL)
41 Q_PROPERTY(QByteArray machineUniqueId READ machineUniqueId CONSTANT FINAL)
42 Q_PROPERTY(QByteArray bootUniqueId READ bootUniqueId CONSTANT FINAL)
43
44public:
45 enum class Endian { Big, Little };
46 Q_ENUM(Endian)
47
48 explicit QQmlSystemInformation(QObject *parent = nullptr);
49
50 int wordSize() const;
51 Endian byteOrder() const;
52 QString buildCpuArchitecture() const;
53 QString currentCpuArchitecture() const;
54 QString buildAbi() const;
55 QString kernelType() const;
56 QString kernelVersion() const;
57 QString productType() const;
58 QString productVersion() const;
59 QString prettyProductName() const;
60 QString machineHostName() const;
61 QByteArray machineUniqueId() const;
62 QByteArray bootUniqueId() const;
63};
64QT_END_NAMESPACE
65
66#endif // QQMLSYSTEMINFORMATION_P_H
67

source code of qtdeclarative/src/core/qqmlsysteminformation_p.h