In questa pagina

QRotationSensor Class

La classe QRotationSensor è un wrapper di comodità che avvolge QSensor. Per saperne di più...

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

Proprietà

Funzioni pubbliche

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

Segnali

void hasZChanged(bool hasZ)

Descrizione dettagliata

L'unica differenza comportamentale è che questa classe imposta correttamente il tipo.

Questa classe dispone inoltre di una funzione reading() che restituisce un QRotationReading invece di un QSensorReading.

Per i dettagli sul funzionamento del sensore, consultare QRotationReading.

Vedi anche QRotationReading.

Documentazione sulle proprietà

[read-only] hasZ : bool

Questa proprietà contiene un valore che indica se l'angolo z è disponibile.

Restituisce true se z è disponibile. Restituisce false se z non è disponibile.

Funzioni di accesso:

bool hasZ() const

Segnale di notifica:

void hasZChanged(bool hasZ)

Documentazione delle funzioni membro

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

Crea il sensore come elemento figlio di parent.

[virtual noexcept] QRotationSensor::~QRotationSensor()

Distruggi il sensore. Arresta il sensore, se non è già stato arrestato.

QRotationReading *QRotationSensor::reading() const

Restituisce la classe di lettura per questo sensore.

Vedi anche QSensor::reading().

void QRotationSensor::setHasZ(bool hasZ)

Stabilisce se l'angolo z è disponibile per hasZ. Questa funzione deve essere chiamata dal backend. Per impostazione predefinita, la proprietà hasZ è impostata su true, quindi un backend deve chiamarla solo se il proprio sensore di rotazione non è in grado di riportare gli angoli z.

Vedi anche 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.