There is another important feature called Geo Routing Request, which is a set of functions that help you plot out the route (often the shortest route) from point A to point B. This feature requires a service provider; in this case, we will be using Open Street Map (OSM) as it is completely free.
Do note that OSM is an online collaborative project, which means that if no one from your area contributed the route data to the OSM server, then you won't be able to get an accurate result. Optionally, you can also use paid services such as Mapbox or ESRI.
Let's see how we can implement Geo Routing Request in Qt! First, include the following headers to our mainwindow.h file:
#include <QGeoServiceProvider>
#include <QGeoRoutingManager>
#include <QGeoRouteRequest>
#include <QGeoRouteReply>
After that, add two slot functions to MainWindow...