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

属性

  • x : const qreal
  • y : const qreal
  • z : const qreal

公共功能

void setX(qreal x)
void setY(qreal y)
void setZ(qreal z)
qreal x() const
qreal y() const
qreal z() const

详细说明

QAccelerometerReading 单位

数值的刻度为米/秒平方。轴线排列如下。

一个静止的单体设备面朝上放在桌子上,在 Z 轴(即朝向屋顶)上会受到大约 9.8 的力。这就是设备相对于自由落体的适当加速度。

属性文档

[read-only] x : const qreal

该属性保存 X 轴上的加速度。

数值的刻度为米/秒的平方。

访问函数:

qreal x() const

另请参见 QAccelerometerReading Units

[read-only] y : const qreal

该属性保存 Y 轴上的加速度。

数值的刻度为米/秒的平方。

访问功能:

qreal y() const

另请参见 QAccelerometerReading Units

[read-only] z : const qreal

该属性用于保存 Z 轴上的加速度。

数值的刻度为米/秒的平方。

访问功能:

qreal z() const

另请参见 QAccelerometerReading Units

成员函数文档

void QAccelerometerReading::setX(qreal x)

将 X 轴的加速度设置为x

另请参见 x() 。

void QAccelerometerReading::setY(qreal y)

将 Y 轴的加速度设置为y

另请参见 y() 。

void QAccelerometerReading::setZ(qreal z)

将 Z 轴的加速度设置为z

另请参见 z() 。

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