The QIRProximityReading class holds readings from the IR proximity sensor.
The IR (infra-red) proximity sensor detects proximity by beaming out infra-red light and detecting how much of the light returns.
The biggest limitation of this technology is that there is no reliable way to turn the reflectance values into distances unless both the item being detected and the ambient conditions are known.
Public Functions Index
|QIRProximityReading (QObject *parent=0)|
|virtual void||copyValuesFrom (QSensorReading *other)|
|qreal||reflectance () const|
|void||setReflectance (qreal reflectance)|
|void||setTimestamp (qtimestamp timestamp)|
|qtimestamp||timestamp () const|
|QVariant||value (int index) const|
|int||valueCount () const|
Protected Functions Index
Holds the reflectance value.
The reflectance is a percentage (from 0 to 100) indicating how much of the transmitted infra-red light was returned.
the timestamp of the reading.
Returns the timestamp of the reading.
Sets the reflectance value to reflectance.
Sets the timestamp of the reading.
Returns the value of the property at index.
Note that this function is slower than calling the data function directly.
Here is an example of getting a property via the different mechanisms available.
Accessing directly provides the best performance but requires compile-time knowledge of the data you are accessing.
QAccelerometerReading *reading = ...; qreal x = reading->x();
You can also access a property by name. To do this you must call QObject::property().
qreal x = reading->property("x").value<qreal>();
Finally, you can access values via numeric index.
qreal x = reading->value(0).value<qreal>();
(Only has inherited protected functions)
QScopedPointer< QSensorReadingPrivate > *
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia. Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.