Simplify declarative wrapper of QGeoRoute


Move the logic of counting, and assembling a list of segments into the
QGeoRoute implementation, using a generic function that iterates the
linked list of segments and calls a functor. Remove the (premature -
how many legs are there - 5?) optimization of caching the list of legs
and segments.

For extended attributes, return the QVariantMap from QGeoRoute rather
than building a declarative map (that is then supposed to be CONSTANT).

Make the getters const.

The only thing stopping QGeoRoute to be directly exposed to QML and the
declarative wrapper to be removed is now the access to the routeQuery
object.

Change-Id: Ie9b86c3b235a75f3bbea086697a6eda02b060264
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
commit634d9772e52e24ad3709da1b5161c421c1a7370e
parentd8f03e5e71de3d951f86f0b0413fd75d554b2039
authorVolker Hilsheimer <volker.hilsheimer@qt.io>
committerVolker Hilsheimer <volker.hilsheimer@qt.io>
commit timeThu, 22 Sep 2022 14:56:44 +0200