QRotationSensor Class

Die QRotationSensor-Klasse ist eine komfortable Hülle für QSensor. Mehr...

Kopfzeile: #include <QRotationSensor>
CMake: find_package(Qt6 REQUIRED COMPONENTS Sensors)
target_link_libraries(mytarget PRIVATE Qt6::Sensors)
qmake: QT += sensors
Vererbt: QSensor

Eigenschaften

Öffentliche Funktionen

QRotationSensor(QObject *parent = nullptr)
virtual ~QRotationSensor()
bool hasZ() const
QRotationReading *reading() const
void setHasZ(bool hasZ)

Signale

void hasZChanged(bool hasZ)

Detaillierte Beschreibung

Der einzige Unterschied im Verhalten besteht darin, dass diese Klasse den Typ richtig setzt.

Diese Klasse verfügt auch über eine reading()-Funktion, die ein QRotationReading anstelle eines QSensorReading zurückgibt.

Einzelheiten zur Funktionsweise des Sensors finden Sie unter QRotationReading.

Siehe auch QRotationReading.

Dokumentation der Eigenschaft

[read-only] hasZ : const bool

Diese Eigenschaft enthält einen Wert, der angibt, ob der z-Winkel verfügbar ist.

Gibt true zurück, wenn z verfügbar ist. Gibt false zurück, wenn z nicht verfügbar ist.

Zugriffsfunktionen:

bool hasZ() const

Benachrichtigungssignal:

void hasZChanged(bool hasZ)

Member Function Dokumentation

[explicit] QRotationSensor::QRotationSensor(QObject *parent = nullptr)

Konstruieren Sie den Sensor als ein Kind von parent.

[virtual noexcept] QRotationSensor::~QRotationSensor()

Zerstört den Sensor. Stoppt den Sensor, wenn er nicht bereits gestoppt wurde.

QRotationReading *QRotationSensor::reading() const

Gibt die Leseklasse für diesen Sensor zurück.

Siehe auch QSensor::reading().

void QRotationSensor::setHasZ(bool hasZ)

Legt fest, ob der Z-Winkel für hasZ verfügbar ist. Dies ist vom Backend aufzurufen. Standardmäßig ist die hasZ Eigenschaft true, so dass ein Backend dies nur aufrufen muss, wenn sein Rotationssensor keine z-Winkel melden kann.

Siehe auch hasZ().

© 2025 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. Qt and 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.