QAccelerometerReading Class
QAccelerometerReading 类用于报告沿 X、Y 和 Z 轴的线性加速度。更多内容...
| 标题: | #include <QAccelerometerReading> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Sensors) target_link_libraries(mytarget PRIVATE Qt6::Sensors) |
| qmake: | QT += sensors |
| 继承自: | QSensorReading |
属性
公共函数
| void | setX(qreal x) |
| void | setY(qreal y) |
| void | setZ(qreal z) |
| qreal | x() const |
| qreal | y() const |
| qreal | z() const |
详细说明
QAccelerometerReading Units
值的量纲为米每秒平方。各轴的排列如下。

一个静止的单块设备,正面朝上放置在桌面上时,将在 Z 轴方向(即朝向天花板方向)受到约 9.8 的力。这是该设备相对于自由落体所经历的正向加速度。
属性文档
[read-only] x : qreal
该属性表示X轴方向上的加速度。
该值的单位为米每秒平方。
访问函数:
| qreal | x() const |
另请参阅 QAccelerometerReading Units 。
[read-only] y : qreal
该属性存储Y轴方向的加速度。
该值的单位为米每秒平方。
访问函数:
| qreal | y() const |
另请参阅 QAccelerometerReading Units 。
[read-only] z : qreal
该属性存储Z轴上的加速度。
该值的单位为米每秒平方。
访问函数:
| qreal | z() const |
另请参阅 QAccelerometerReading Units 。
© 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.