QtMobility Reference Documentation

QIRProximityReading Class Reference

The QIRProximityReading class holds readings from the IR proximity sensor. More...

 #include <QIRProximityReading>

Inherits: QSensorReading.

Properties

Public Functions

qreal reflectance () const
void setReflectance ( qreal reflectance )

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 1 signal inherited from QObject
  • 1 public variable inherited from QObject
  • 4 static public members inherited from QObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

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.

QIRProximityReading Units

The sensor reports reflectance as a percentage. That is, 0 indicates nothing was detected within the range of the sensor and 100 indicates the infra-red signal returned at the full power level that it was sent at.

With some IR sensors, it is quite uncommon to reach the top and the bottom of the value range, and some parts of the range ends might not be obtainable at all. This is due to the behavior of the sensor hardware. With these sensors, the absolute value of reflectance should never be used directly. Instead, applications should react to the relative change of the reading values. Use QProximitySensor if it is only necessary to check if something is close to the device or not.

Property Documentation

reflectance : const qreal

This property holds the reflectance value.

The reflectance is a percentage (from 0 to 100) indicating how much of the transmitted infra-red light was returned.

Access functions:

qreal reflectance () const

See also QIRProximityReading Units.

Member Function Documentation

void QIRProximityReading::setReflectance ( qreal reflectance )

Sets the reflectance value to reflectance.

See also reflectance().

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.