QDistanceReading 类

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

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

特性

公共函数

QDistanceReading (QObject * parent = DECLARE_READING(QDistanceReading))
virtual ~QDistanceReading ()
qreal distance () const
void setDistance (qreal distance )

重实现公共函数

virtual void copyValuesFrom (QSensorReading * other ) override

静态公共成员

const QMetaObject staticMetaObject

额外继承成员

详细描述

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

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 单位 .

成员函数文档编制

QDistanceReading:: QDistanceReading ( QObject * parent = DECLARE_READING(QDistanceReading))

Default constructs an instance of QDistanceReading.

[虚拟] QDistanceReading:: ~QDistanceReading ()

Destroys the instance of QDistanceReading. The destructor is virtual.

[override virtual] void QDistanceReading:: copyValuesFrom ( QSensorReading * other )

void QDistanceReading:: setDistance ( qreal distance )

将距离设为 distance .

另请参阅 distance ().