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 .
返回用于此传感器的读取类。
另请参阅 QSensor::reading ().