QCompass on iOS using Qt 5.2.0-beta1
Did anyone succeed on accessing the Compass sensor of an iPhone using QCompass and QCompassFilter classes with Qt 5.2.0-beta1 version? I've tried it through several different ways, with no success. I'm using XCode 4.6.3 and iOS 6.0.1.
The exact issue is that "bool QSensor::start()" method always returns "false" and then nothing happens.
According to the "Compatibility Map" of Qt 5.2 Sensors, the following features are supposed to work on iOS : Accelerometer, Compass, Gyroscope, Magnetometer and Proximity Sensors.
In my tests, neither Accelerometer nor Compass are working.
Hi and welcome to devnet,
Did you test it on the simulator or a real device ? AFAIK, the simulator doesn't provide everything a device does.
In the second case, you should check the "bug report system":http://bugreports.qt-project.org To see whether it something known. If not you can open a new report providing a minimal compilable example that shows the bug.
Thank you. I actually tested on a real device (iPhone 4s / iOS 6.0.1). However, it seems that no sensor works correctly (QSensor::start() always returns false). I'll check the "bug report system".
Definitely, QSensor class is not working yet for iOS devices (with Qt 5.2.0-beta1) version. I've tried several simple test Apps for instantiating and detecting sensors on several devices (iPhone and iPad), with different versions of XCode (4.6.3 and 5.0.1) and iOS (iOS5 , iOS6 and iOS7).
QSensor::sensorTypes() should return a list of available sensors but, instead, returns an empty list. As there aren't sensors available, QSensor::start() always returns false (failing to start any sensor).
I hope we all have a better luck with the final release of Qt 5.2.0.
You should rather ask the status on the interest mailing list, during the DD in Berlin there was a demonstration using QtQuick and the accelerometers
so there should be something
Any idea if this has been fixed? I'm using 5.2.1 and am seeing the same issue.
To make sensors work with iOS Apps, just make sure the following statements are included in your .PRO files :
QT += sensors
QTPLUGIN += qtsensors_ios
I think it is the same of this one:
Thanks cezmen, that's what I needed.