How can I calculate distance in QT by geocoordinates given by Qgeopositioninfo ? How can I fetch 2 coordinates: now and previous, and calculate? My trouble is: how to fetch 2 coordinates: which is given now, and which was given previous, and after calculating set now as previous ???
Asked
Active
Viewed 695 times
1 Answers
0
You can use QGeoCoordinate::distanceTo(QGeoCoordinate) that returns a value in meters.
distance = previous.distanceTo(now);

José Morais
- 359
- 5
- 20