M
M
MrShaggy2016-06-04 12:56:04
Qt
MrShaggy, 2016-06-04 12:56:04

How to get the geo position of a device. C++/Qt?

Good day.
I am writing in C++/Qt in OS X operating system. There was a need to find out the location of the device. Off. docs found the QGeoPositionInfoSource class. I can't get the tool to work because it doesn't return the corresponding object.
Clipping from the docks:
====================
QGeoPositionInfoSource *QGeoPositionInfoSource::createDefaultSource(QObject *parent)
Creates and returns a position source with the given parent that reads from the system's default sources of location data, or the plugin with the highest available priority.
Returns 0 if the system has no default position source, no valid plugins could be found or the user does not have the permission to access the current position.
===================
Please help me figure out how to make it return the geo position. While I suspect that the application stupidly does not have access.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question