本页内容

QTiltReading Class

QTiltReading 类存储了来自倾斜传感器的读数。更多内容...

头文件: #include <QTiltReading>
CMake: find_package(Qt6 REQUIRED COMPONENTS Sensors)
target_link_libraries(mytarget PRIVATE Qt6::Sensors)
qmake: QT += sensors
继承自: QSensorReading

属性

公共函数

void setXRotation(qreal x)
void setYRotation(qreal y)
qreal xRotation() const
qreal yRotation() const

详细说明

倾斜传感器报告设备在X和Y平面上的倾斜角度(单位为度)。

属性文档

[read-only] xRotation : qreal

该属性存储X轴方向的倾斜角度,单位为度。

访问函数:

qreal xRotation() const

[read-only] yRotation : qreal

该属性存储Y轴方向的倾斜角度,单位为度。

访问函数:

qreal yRotation() const

成员函数文档

void QTiltReading::setXRotation(qreal x)

将xRotation 设置为x 度。

另请参阅 xRotation()。

void QTiltReading::setYRotation(qreal y)

将yRotation 设置为y 度。

另请参阅 yRotation()。

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