summaryrefslogtreecommitdiffstats
path: root/src/plugins/sensors/ios/main.mm
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2013-04-08 11:24:19 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-16 21:23:38 +0200
commit48b6efda253189ea7e3c3238c10cdced61927a10 (patch)
tree9c7e18123f1c0ff51d36c6e7600dc5283f8aa181 /src/plugins/sensors/ios/main.mm
parenta16f81a365b7d9a6629b04bd298a3b45fc1b7628 (diff)
iOS: implement compass
Change-Id: I639a472cd2dfca177282cb4961d589f11f924e36 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 25b41b60..8797b8ee 100644
--- a/src/plugins/sensors/ios/main.mm
+++ b/src/plugins/sensors/ios/main.mm
@@ -47,6 +47,7 @@
#include "iosaccelerometer.h"
#include "iosgyroscope.h"
#include "iosmagnetometer.h"
+#include "ioscompass.h"
class IOSSensorPlugin : public QObject, public QSensorPluginInterface, public QSensorBackendFactory
{
@@ -61,6 +62,8 @@ public:
QSensorManager::registerBackend(QGyroscope::type, IOSGyroscope::id, this);
if ([QIOSMotionManager sharedManager].magnetometerAvailable)
QSensorManager::registerBackend(QMagnetometer::type, IOSMagnetometer::id, this);
+ if ([CLLocationManager headingAvailable])
+ QSensorManager::registerBackend(QCompass::type, IOSCompass::id, this);
}
QSensorBackend *createBackend(QSensor *sensor)
@@ -71,6 +74,8 @@ public:
return new IOSGyroscope(sensor);
if (sensor->identifier() == IOSMagnetometer::id)
return new IOSMagnetometer(sensor);
+ if (sensor->identifier() == IOSCompass::id)
+ return new IOSCompass(sensor);
return 0;
}