QRotationSensor Class
La clase `QRotationSensor` es un envoltorio de uso sencillo que envuelve a ` QSensor`. Más información...
| Encabezado: | #include <QRotationSensor> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Sensors) target_link_libraries(mytarget PRIVATE Qt6::Sensors) |
| qmake: | QT += sensors |
| Heredado de: | QSensor |
Propiedades
- hasZ : bool
Funciones públicas
| QRotationSensor(QObject *parent = nullptr) | |
| virtual | ~QRotationSensor() |
| bool | hasZ() const |
| QRotationReading * | reading() const |
| void | setHasZ(bool hasZ) |
Señales
| void | hasZChanged(bool hasZ) |
Descripción detallada
La única diferencia de comportamiento es que esta clase establece el tipo correctamente.
Esta clase también cuenta con una función ` reading()` que devuelve un ` QRotationReading ` en lugar de un ` QSensorReading`.
Para obtener más información sobre el funcionamiento del sensor, consulta QRotationReading.
Véase también QRotationReading.
Documentación de propiedades
[read-only] hasZ : bool
Esta propiedad contiene un valor que indica si el ángulo z está disponible.
Devuelve «true» si z está disponible. Devuelve «false» si z no está disponible.
Funciones de acceso:
| bool | hasZ() const |
Señal de notificación:
| void | hasZChanged(bool hasZ) |
Documentación de las funciones de miembro
[explicit] QRotationSensor::QRotationSensor(QObject *parent = nullptr)
Crea el sensor como un elemento secundario de parent.
[virtual noexcept] QRotationSensor::~QRotationSensor()
Destruye el sensor. Detiene el sensor si aún no se ha detenido.
QRotationReading *QRotationSensor::reading() const
Devuelve la clase de lectura de este sensor.
Véase también QSensor::reading().
void QRotationSensor::setHasZ(bool hasZ)
Establece si el ángulo Z está disponible para hasZ. Esta llamada debe realizarse desde el backend. Por defecto, la propiedad hasZ tiene el valor «true», por lo que un backend solo tiene que llamar a esta función si su sensor de rotación no puede proporcionar los ángulos Z.
Véase también 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.