In questa pagina

QTiltSensor Class

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

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

Funzioni pubbliche

QTiltSensor(QObject *parent = nullptr)
virtual ~QTiltSensor()
void calibrate()
QTiltReading *reading() const

Descrizione dettagliata

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

Questa classe dispone inoltre della funzione reading() che restituisce un oggetto QTiltReading anziché un QSensorReading.

Per i dettagli sul funzionamento del sensore, consultare QTiltReading.

Vedi anche QTiltReading.

Documentazione sulle funzioni membro

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

Crea il sensore come elemento figlio di parent.

[virtual noexcept] QTiltSensor::~QTiltSensor()

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

[invokable] void QTiltSensor::calibrate()

Calibra il sensore di inclinazione. Considera gli angoli di inclinazione attuali pari a 0 gradi.

Nota: questa funzione può essere richiamata tramite il sistema dei meta-oggetti e da QML. Vedi Q_INVOKABLE.

QTiltReading *QTiltSensor::reading() const

Restituisce la classe di lettura per questo sensore.

Vedi anche QSensor::reading().

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