Results 1 to 2 of 2

Thread: iOS Geolocation problem

  1. #1
    Join Date
    Nov 2015
    Qt products
    MacOS X

    Default iOS Geolocation problem

    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);
    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. }
    19. void MainWindow::positionUpdated(const QGeoPositionInfo &info)
    20. {
    21. qDebug() << "Position updated:" << info;
    22. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Nov 2015
    Qt products
    MacOS X

    Default Re: iOS Geolocation problem

    After a lot of effort i managed to solve the problem. You have to manually edit info.plist in xcode or a text editor. See the info in this post!

Similar Threads

  1. How to use QtWebkit with geolocation?
    By brcontainer in forum Qt Programming
    Replies: 1
    Last Post: 31st March 2015, 21:42

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.