Important: Please read the Qt Code of Conduct -

How: QT Positioning - showCurrentLocation Button??

  • Hello,

    I am looking to get some general advice on how to solve this problem I'm interested in.

    I have a program that has a GUI that displays an Online Base Map from the Esri SDK for QT. It also gives you the option to use offline tiled layered maps.

    I've looked over some of the code examples provided by QT but they seem a bit too much for what I need and I'm still having a hard time how to approach the initial part.

    All I want to do is:
    Press a button called "My Location" on the GUI that will first call some source/API that can detect my location, then I would just do some stuff with the data, and finally reload the map given the new coordinates.

    The only problem I have is how get the coordinates of my current location. If I can solve this part, I can do the rest.

    I've been looking at the QTPositioning Library, and looking deeper into certain functions such as ~QGeoPositionInfoSource(), QGeoPositionInfoSource::createDefaultSource() , and looking at examples.

    What all is needed to get my current location?
    What are these "plug-ins or sources" they speak of that I need to accomplish this if I'm writing this using Ubuntu on a Desktop.

    I would say I'm just having a hard time understanding what plug-in/source are needed to do this. I would appreciate any guidance.


  • @zeethree50 you may want to take a look at this weather example regarding how they use the device's GPS to know current position...