diff options
author | Yuhang Zhao <2546789017@qq.com> | 2022-07-07 10:14:01 +0800 |
---|---|---|
committer | Yuhang Zhao <2546789017@qq.com> | 2022-07-09 15:38:36 +0800 |
commit | 9c02a390c4c3dc94339499ce67557f59de4049f5 (patch) | |
tree | 24ca20040da0ee4da72b87f913f4896fa3b8a67b /src/core | |
parent | 7e6db64d4370ee2bf30572aebf1905729cf594dc (diff) |
QtQmlCore: Add missing parts to SystemInformation
QSysInfo from QtCore has two additional properties,
this change adds them the the SystemInformation type.
Amends commit 39635d025444e61acc0417b088411199b6bea334
Pick-to: 6.4
Change-Id: I4a2aad5b00e53b97e794d13d14cd7f62e8724947
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/qqmlsysteminformation.cpp | 10 | ||||
-rw-r--r-- | src/core/qqmlsysteminformation_p.h | 7 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/core/qqmlsysteminformation.cpp b/src/core/qqmlsysteminformation.cpp index b067c6eb2b..589a40858e 100644 --- a/src/core/qqmlsysteminformation.cpp +++ b/src/core/qqmlsysteminformation.cpp @@ -27,6 +27,16 @@ QQmlSystemInformation::QQmlSystemInformation(QObject *parent) : QObject(parent) { } +int QQmlSystemInformation::wordSize() const +{ + return QSysInfo::WordSize; +} + +QQmlSystemInformation::Endian QQmlSystemInformation::byteOrder() const +{ + return static_cast<Endian>(QSysInfo::ByteOrder); +} + QString QQmlSystemInformation::buildCpuArchitecture() const { return QSysInfo::buildCpuArchitecture(); diff --git a/src/core/qqmlsysteminformation_p.h b/src/core/qqmlsysteminformation_p.h index 919d1e73eb..868bce1823 100644 --- a/src/core/qqmlsysteminformation_p.h +++ b/src/core/qqmlsysteminformation_p.h @@ -27,6 +27,8 @@ class Q_QMLCORE_PRIVATE_EXPORT QQmlSystemInformation : public QObject QML_NAMED_ELEMENT(SystemInformation) QML_ADDED_IN_VERSION(6, 4) + Q_PROPERTY(int wordSize READ wordSize CONSTANT FINAL) + Q_PROPERTY(QQmlSystemInformation::Endian byteOrder READ byteOrder CONSTANT FINAL) Q_PROPERTY(QString buildCpuArchitecture READ buildCpuArchitecture CONSTANT FINAL) Q_PROPERTY(QString currentCpuArchitecture READ currentCpuArchitecture CONSTANT FINAL) Q_PROPERTY(QString buildAbi READ buildAbi CONSTANT FINAL) @@ -40,8 +42,13 @@ class Q_QMLCORE_PRIVATE_EXPORT QQmlSystemInformation : public QObject Q_PROPERTY(QByteArray bootUniqueId READ bootUniqueId CONSTANT FINAL) public: + enum class Endian { Big, Little }; + Q_ENUM(Endian) + explicit QQmlSystemInformation(QObject *parent = nullptr); + int wordSize() const; + Endian byteOrder() const; QString buildCpuArchitecture() const; QString currentCpuArchitecture() const; QString buildAbi() const; |