diff options
author | Thomas McGuire <thomas.mcguire.qnx@kdab.com> | 2013-01-08 16:55:38 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-23 18:32:35 +0100 |
commit | 02285d735e7d3bd8ddfb61b7ea5e16da4ad522d1 (patch) | |
tree | 6000899044feee17aae140df56eba1aa6126ffee /tests | |
parent | bbf9a9f61a18ccb478cbca414d85ed531f078966 (diff) | |
download | qtsensors-02285d735e7d3bd8ddfb61b7ea5e16da4ad522d1.tar.gz |
Add QPressureSensor
This adds a new QPressureSensor plus the assorted reading and filter
classes, as well as a QML API.
The Blackberry backend is ported to use the new reading class.
Change-Id: Ifc86a2ae955a9337a67fd9a86ceabab908917cb3
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qsensor/test_backends.h | 4 | ||||
-rw-r--r-- | tests/auto/qsensor/tst_qsensor.cpp | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qsensor/test_backends.h b/tests/auto/qsensor/test_backends.h index a36a858..e47cfd5 100644 --- a/tests/auto/qsensor/test_backends.h +++ b/tests/auto/qsensor/test_backends.h @@ -54,6 +54,7 @@ void unregister_test_backends(); #include <qlightsensor.h> #include <qmagnetometer.h> #include <qorientationsensor.h> +#include <qpressuresensor.h> #include <qproximitysensor.h> #include <qrotationsensor.h> #include <qtapsensor.h> @@ -120,6 +121,9 @@ PREPARE_SENSORINTERFACE(QMagnetometer, QMagnetometerReading, QMagnetometerFilter PREPARE_SENSORINTERFACE(QOrientationSensor, QOrientationReading, QOrientationFilter, { reading->setOrientation(QOrientationReading::LeftUp); }) +PREPARE_SENSORINTERFACE(QPressureSensor, QPressureReading, QPressureFilter, { + reading->setPressure(1.0); +}) PREPARE_SENSORINTERFACE(QProximitySensor, QProximityReading, QProximityFilter, { reading->setClose(true); }) diff --git a/tests/auto/qsensor/tst_qsensor.cpp b/tests/auto/qsensor/tst_qsensor.cpp index 3852f7e..3dbcb68 100644 --- a/tests/auto/qsensor/tst_qsensor.cpp +++ b/tests/auto/qsensor/tst_qsensor.cpp @@ -877,6 +877,10 @@ private slots: QCOMPARE(reading->orientation(), QOrientationReading::LeftUp); }) + TEST_SENSORINTERFACE(QPressureSensor, QPressureReading, { + QCOMPARE(reading->pressure(), 1.0); + }) + TEST_SENSORINTERFACE(QProximitySensor, QProximityReading, { QCOMPARE(reading->close(), true); }) |