QTiltSensor Class

The QTiltSensor class is a convenience wrapper around QSensor . 更多...

頭: #include <QTiltSensor>
CMake: find_package(Qt6 REQUIRED COMPONENTS Sensors)
target_link_libraries(mytarget PRIVATE Qt6::Sensors)
qmake: QT += sensors
繼承: QSensor

公共函數

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

詳細描述

唯一行為差異是此類正確設置類型。

此類還特徵 reading () 函數返迴 QTiltReading 而不是 QSensorReading .

有關傳感器如何工作的細節,見 QTiltReading .

另請參閱 QTiltReading .

成員函數文檔編製

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

構造傳感器作為子級對於 parent .

[virtual noexcept] QTiltSensor:: ~QTiltSensor ()

銷毀傳感器。停止傳感器若尚未停止。

[invokable] void QTiltSensor:: calibrate ()

Calibrates the tilt sensor. Uses the current tilt angles as 0 degrees.

注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .

QTiltReading *QTiltSensor:: reading () const

返迴用於此傳感器的讀取類。

另請參閱 QSensor::reading ().