diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-11-06 14:02:36 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-11-29 23:02:35 +0000 |
commit | 3e107c6d2933b4b924100d1aab18f52f7ca40edc (patch) | |
tree | 20b87cef43353cad503f2cf294f21d4755130691 /tests/auto/geotestplugin | |
parent | efcffce97117f571fcf4bf745426eb36ef784804 (diff) | |
download | qtlocation-3e107c6d2933b4b924100d1aab18f52f7ca40edc.tar.gz |
Allow to specify extra parameters in RouteQuery using MapParameters
This patch works on top of the previous one, and passes the content of
the map parameters as a QMap<QString, QVariantMap>, where the key is the
parameter type and the value is a map<property name, property value> of
all properties of the map parameter except for the property "type".
To achieve this, a new list property, quickChildren, has been added to
RouteQuery, to pick up Map Parameters declared inside the query
Change-Id: I364f5438e8f4cfc42430bfe448d96519c407eb74
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'tests/auto/geotestplugin')
-rw-r--r-- | tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h b/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h index 0a1e7ce6..f4067857 100644 --- a/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h +++ b/tests/auto/geotestplugin/qgeoroutingmanagerengine_test.h @@ -134,9 +134,14 @@ public: void setRoutes(const QGeoRouteRequest& request, RouteReplyTest* reply) { QList<QGeoRoute> routes; + int travelTime = 0; + if (request.extraParameters().contains("test-traveltime")) + travelTime = request.extraParameters().value("test-traveltime").value("requestedTime").toInt(); + for (int i = 0; i < request.numberAlternativeRoutes(); ++i) { QGeoRoute route; route.setPath(request.waypoints()); + route.setTravelTime(travelTime); routes.append(route); } reply->callSetRoutes(routes); |