QDistanceReading Class

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

头文件: #include <QDistanceReading>
qmake: QT += sensors
开始支持版本: Qt 5.4
基类: QSensorReading

属性

公有函数

qreal distance() const
void setDistance(qreal distance)

其他继承的成员

  • 1 个公有槽函数继承自 QObject
  • 2 个信号继承自 QObject
  • 1 个公有变量继承自 QObject
  • 10 个静态公有成员继承自 QObject
  • 9 个受保护的函数继承自 QObject
  • 2 个受保护的变量继承自 QObject

详细描述

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 Units

The distance is measured in cm

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

distance of object from front face of device

访问函数:

qreal distance() const

参见 QDistanceReading Units.

成员函数

void QDistanceReading::setDistance(qreal distance)

Sets distance to distance.

参见 distance().