En esta página

QRotationSensor Class

La clase QRotationSensor es una envoltura de conveniencia alrededor de QSensor. Más...

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

Propiedades

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 presenta una función reading() que devuelve un QRotationReading en lugar de un QSensorReading.

Para más detalles sobre el funcionamiento del sensor, véase 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 del notificador:

void hasZChanged(bool hasZ)

Documentación de la función miembro

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

Construye el sensor como hijo 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. Esto debe ser llamado desde el backend. Por defecto la propiedad hasZ es true, por lo que un backend sólo tiene que llamar a esto si su sensor de rotación no puede informar de los ángulos z.

Ver 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.