1

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 ???

user707895
  • 351
  • 1
  • 4
  • 15

1 Answers1

0

You can use QGeoCoordinate::distanceTo(QGeoCoordinate) that returns a value in meters.

distance = previous.distanceTo(now);
José Morais
  • 359
  • 5
  • 20