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.
距离以厘米为单位度量
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.
对象与设备正面的距离
访问函数:
qreal | distance () const |
另请参阅 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
)
将距离设为 distance .
另请参阅 distance ().