summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-11 10:42:38 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-22 14:56:44 +0200
commit634d9772e52e24ad3709da1b5161c421c1a7370e (patch)
tree0ca1a58b44a78912ecbbe1848ab8df79eb15959f /tests
parentd8f03e5e71de3d951f86f0b0413fd75d554b2039 (diff)
downloadqtlocation-634d9772e52e24ad3709da1b5161c421c1a7370e.tar.gz
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h b/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h
index e60b2d2b..e1815b35 100644
--- a/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h
+++ b/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h
@@ -48,7 +48,6 @@ class QGeoRoutePrivateDefaultAlt : public QGeoRoutePrivateDefault
public:
QGeoRoutePrivateDefaultAlt() : QGeoRoutePrivateDefault()
{
- m_travelTime = 123456; // To identify this is actually a QGeoRoutePrivateDefaultAlt
}
QGeoRoutePrivateDefaultAlt(const QGeoRoutePrivateDefaultAlt &other)
: QGeoRoutePrivateDefault(other) {}
@@ -58,6 +57,10 @@ public:
{
Q_UNUSED(travelTime);
}
+ int travelTime() const override
+ {
+ return 123456; // To identify this is actually a QGeoRoutePrivateDefaultAlt
+ }
};
class QGeoRouteAlt : public QGeoRoute