I would appreciate if anybody can help me with this (did not find anything relevant with Google).
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. Any ideas?
Here is my code:
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QGeoPositionInfoSource *source = QGeoPositionInfoSource::createDefaultSource(this);
if (source){
connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)),this, SLOT(positionUpdated(QGeoPositionInfo)));
source->setUpdateInterval(100);
source->startUpdates();
qDebug()<<"Source found";
qDebug()<<source->availableSources();
}else{
qDebug()<<"Failed source";
}
}
void MainWindow::positionUpdated(const QGeoPositionInfo &info)
{
qDebug() << "Position updated:" << info;
}
UPDATE----------------------------- Getting the error from source says "An unidentified error occurred.". Not very helpful but at least its not an issue related to lacking privileges (error 0).