QDistanceReading 类

The QDistanceReading class holds distance reading in cm from the proximity sensor. 更多...

头: #include <QDistanceReading>
qmake: QT += sensors
Since: Qt 5.4
继承: QSensorReading

该类在 Qt 5.4 引入。

特性

公共函数

qreal distance () const
void setDistance (qreal distance )

详细描述

The QDistanceReading class holds distance reading in cm from the proximity sensor. Note: Some proximity sensor only support two values for distance, a near and far value. In this case, the sensor should report its maximum range value to represent the far state, and a lesser value to represent the near state.

QDistanceReading 单位

距离以厘米为单位度量

The distance sensor is typically located in the front face of a device, and thus will measure the distance of an object from the device's front face.

特性文档编制

distance : const qreal

对象与设备正面的距离

访问函数:

qreal distance () const

另请参阅 QDistanceReading 单位 .

成员函数文档编制

void QDistanceReading:: setDistance ( qreal distance )

将距离设为 distance .

另请参阅 distance ().