Create a new sensor type for distance.
authorAndrew Inwood <ainwood@blackberry.com>
Tue, 25 Mar 2014 18:13:35 +0000 (14:13 -0400)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 28 Mar 2014 20:17:48 +0000 (21:17 +0100)
commitcc8c26d77db10eef152432caf3f8e677c0fffb21
tree82bfe2c001779e54296db6e51140c0c8507699ef
parent01e97935c61498adb650d2e639ac8948a5e67a8f
Create a new sensor type for distance.

Create a new sensor type for distance. This sensor type supports new hardware sensors
that can measure physical distance from the device, in centimeters. The API is designed
to mimic the Android API for proximity (TYPE_PROXIMITY), so that if a given proximity
sensor only supports a binary measurement (near vs far), then instead of reporting distance
in cm, the QDistanceSensor will return the max range value to represent far, and a lesser
value to represent close. Using this definition should simplify implementation.

The main reason for not implementing this as a new property of QProximitySensor is that
clients of QProximitySensor have made the assumption that they will receive the readingReady
signal if and only if the reading has changed from near to far or vice versa. Adding a
distance property will break that assumption, as distance has a higher degree of precision.

Change-Id: Ia804948c78ff7391fc8b78df975cddcf861326dc
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
12 files changed:
src/imports/sensors/qmldistancesensor.cpp [new file with mode: 0644]
src/imports/sensors/qmldistancesensor.h [new file with mode: 0644]
src/imports/sensors/sensors.pro
src/plugins/sensors/blackberry/bbdistancesensor.cpp [new file with mode: 0644]
src/plugins/sensors/blackberry/bbdistancesensor.h [new file with mode: 0644]
src/plugins/sensors/blackberry/blackberry.pro
src/plugins/sensors/blackberry/main.cpp
src/sensors/doc/src/compatmap.qdoc
src/sensors/qdistancesensor.cpp [new file with mode: 0644]
src/sensors/qdistancesensor.h [new file with mode: 0644]
src/sensors/qdistancesensor_p.h [new file with mode: 0644]
src/sensors/sensors.pro