summaryrefslogtreecommitdiffstats
path: root/src/plugins/sensors/ios/main.mm
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2013-03-20 12:50:04 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-14 11:31:32 +0200
commita16f81a365b7d9a6629b04bd298a3b45fc1b7628 (patch)
tree4ecaf670ea48d19be63942b61ce3c090ec30f9b0 /src/plugins/sensors/ios/main.mm
parentc0387812954819286543a8bba70dd0f1c4796c12 (diff)
iOS: implement magnetometer
Change-Id: I611e1ccafb0362b78737785e9cc7f4f48278063a Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com>
Diffstat (limited to 'src/plugins/sensors/ios/main.mm')
-rw-r--r--src/plugins/sensors/ios/main.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/sensors/ios/main.mm b/src/plugins/sensors/ios/main.mm
index efa5370a..25b41b60 100644
--- a/src/plugins/sensors/ios/main.mm
+++ b/src/plugins/sensors/ios/main.mm
@@ -46,6 +46,7 @@
#include "iosmotionmanager.h"
#include "iosaccelerometer.h"
#include "iosgyroscope.h"
+#include "iosmagnetometer.h"
class IOSSensorPlugin : public QObject, public QSensorPluginInterface, public QSensorBackendFactory
{
@@ -58,6 +59,8 @@ public:
QSensorManager::registerBackend(QAccelerometer::type, IOSAccelerometer::id, this);
if ([QIOSMotionManager sharedManager].gyroAvailable)
QSensorManager::registerBackend(QGyroscope::type, IOSGyroscope::id, this);
+ if ([QIOSMotionManager sharedManager].magnetometerAvailable)
+ QSensorManager::registerBackend(QMagnetometer::type, IOSMagnetometer::id, this);
}
QSensorBackend *createBackend(QSensor *sensor)
@@ -66,6 +69,8 @@ public:
return new IOSAccelerometer(sensor);
if (sensor->identifier() == IOSGyroscope::id)
return new IOSGyroscope(sensor);
+ if (sensor->identifier() == IOSMagnetometer::id)
+ return new IOSMagnetometer(sensor);
return 0;
}