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-10 11:45:32 +0200
commit478ec8819427f783cba05601779cfce9dba1d55c (patch)
tree8b6346dd38adb1f207d0aef1872149db59fc2295 /src/plugins/sensors/ios/main.mm
parentb19ca723198a549874eb4c49c21431aa84d04e96 (diff)
iOS: implement magnetometer
Change-Id: I611e1ccafb0362b78737785e9cc7f4f48278063a Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.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;
}