QRotationSensor Class
Die Klasse „QRotationSensor“ ist ein Komfort-Wrapper für „ QSensor “. Mehr...
| Header: | #include <QRotationSensor> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Sensors) target_link_libraries(mytarget PRIVATE Qt6::Sensors) |
| qmake: | QT += sensors |
| Erbt von: | QSensor |
Eigenschaften
- hasZ : bool
Öffentliche Funktionen
| QRotationSensor(QObject *parent = nullptr) | |
| virtual | ~QRotationSensor() |
| bool | hasZ() const |
| QRotationReading * | reading() const |
| void | setHasZ(bool hasZ) |
Signale
| void | hasZChanged(bool hasZ) |
Ausführliche Beschreibung
Der einzige Unterschied im Verhalten besteht darin, dass diese Klasse den Typ korrekt festlegt.
Diese Klasse verfügt außerdem über eine Funktion „ reading()“, die anstelle eines „ QSensorReading “ einen „ QRotationReading “ zurückgibt.
Einzelheiten zur Funktionsweise des Sensors finden Sie unter „ QRotationReading “.
Siehe auch QRotationReading.
Dokumentation zu den Eigenschaften
[read-only] hasZ : 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) |
Dokumentation der Member-Funktionen
[explicit] QRotationSensor::QRotationSensor(QObject *parent = nullptr)
Erstellen Sie den Sensor als untergeordnetes Element von „ parent “.
[virtual noexcept] QRotationSensor::~QRotationSensor()
Den Sensor zerstören. Stoppt den Sensor, sofern er nicht bereits gestoppt wurde.
QRotationReading *QRotationSensor::reading() const
Gibt die Messklasse 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 muss vom Backend aufgerufen werden. Standardmäßig ist die Eigenschaft „ hasZ “ auf „true“ gesetzt, sodass ein Backend dies nur aufrufen muss, wenn sein Rotationssensor keine Z-Winkel melden kann.
Siehe auch „ hasZ()“.
© 2026 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.