Hi, I really would appreciate if anybody can help me with this... I searched this forum and Google already with no success.

I am trying to get positioning info in iOS using Qt. Have tried the simulator as well as a real iPhone. I get at source from QGeoPositionInfoSource that says "corelocation", but source does not seem to emit a signal since positionUpdated never gets called. Getting the error from source returns 2 "An unidentified error occurred." Any ideas?

Here is my code:
Qt Code:
  1. MainWindow::MainWindow(QWidget *parent) :
  2. QMainWindow(parent),
  3. ui(new Ui::MainWindow)
  4. {
  5. ui->setupUi(this);
  6.  
  7. QGeoPositionInfoSource *source = QGeoPositionInfoSource::createDefaultSource(this);
  8. if (source){
  9. connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)),this, SLOT(positionUpdated(QGeoPositionInfo)));
  10. source->setUpdateInterval(100);
  11. source->startUpdates();
  12. qDebug()<<"Source found";
  13. qDebug()<<source->availableSources();
  14. }else{
  15. qDebug()<<"Failed source";
  16. }
  17. }
  18.  
  19. void MainWindow::positionUpdated(const QGeoPositionInfo &info)
  20. {
  21. qDebug() << "Position updated:" << info;
  22. }
To copy to clipboard, switch view to plain text mode