diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-09-26 12:02:12 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2022-10-04 12:23:21 +0200 |
commit | 16e6505c953d6d8d8f05f89ae052a9dd6ccf828e (patch) | |
tree | b80c21b524acc8896bcf1081bcc1b1428868ea25 /tests | |
parent | 8b9bd24556214074d0930716e1cfe918471f42b6 (diff) | |
download | qtlocation-16e6505c953d6d8d8f05f89ae052a9dd6ccf828e.tar.gz |
Register QGeoRoute as QML value type, remove QDeclarativeGeoRoute
Adapt model and tests accordingly.
Fixes: QTBUG-106482
Change-Id: Ie5a36e4fef17ae7bc4ecfab9187a325fb025e283
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests')
4 files changed, 14 insertions, 15 deletions
diff --git a/tests/auto/declarative_location_core/tst_routing.qml b/tests/auto/declarative_location_core/tst_routing.qml index 7d442d96..faf68328 100644 --- a/tests/auto/declarative_location_core/tst_routing.qml +++ b/tests/auto/declarative_location_core/tst_routing.qml @@ -75,7 +75,7 @@ Item { property variant unitBox: QtPositioning.rectangle(tl, br) property routeSegment emptySegment - Route {id: emptyRoute} + property route emptyRoute TestCase { name: "RouteManeuver RouteSegment and MapRoute" @@ -502,7 +502,7 @@ Item { compare(errorSpy.count, 1) errorSpy.clear() var data = errorModel.get(-1) - compare(data, null) + compare(data, emptyRoute) } } @@ -759,11 +759,10 @@ Item { compare (routeQuery.waypoints.length, 5) compare (routeModel.get(0).path.length, 5) compare (routeModel.get(0).path[0].latitude, routeQuery.waypoints[0].latitude) - // test Route.equals + // test comparison var route1 = routeModel.get(0) var route2 = routeModelEquals.get(0) - verify(route1 !== route2) - verify(route1.equals(route2)) + verify(route1 === route2) // check reset() functionality routeModel.reset() tryCompare (testRoutesSpy, "count", 2) // 5 sec diff --git a/tests/auto/declarative_ui/tst_map_item.qml b/tests/auto/declarative_ui/tst_map_item.qml index c9a49f5e..6605eec1 100644 --- a/tests/auto/declarative_ui/tst_map_item.qml +++ b/tests/auto/declarative_ui/tst_map_item.qml @@ -66,13 +66,13 @@ Item { property variant someCoordinate1: QtPositioning.coordinate(15, 15) property variant someCoordinate2: QtPositioning.coordinate(16, 16) - Route { id: someRoute; + property route someRoute: ({ path: [ { latitude: 22, longitude: 15 }, { latitude: 21, longitude: 16 }, { latitude: 23, longitude: 17 } ] - } + }) Item { id: someItem } ItemGroup { @@ -202,13 +202,13 @@ Item { id: preMapRoute line.color: 'yellow' // don't try this at home - route is not user instantiable - route: Route { + route: ({ path: [ { latitude: 25, longitude: 14 }, { latitude: 20, longitude: 18 }, { latitude: 15, longitude: 15 } ] - } + }) SignalSpy {id: preMapRouteRouteChanged; target: parent; signalName: "routeChanged"} SignalSpy {id: preMapRouteLineWidthChanged; target: parent.line; signalName: "widthChanged"} SignalSpy {id: preMapRouteLineColorChanged; target: parent.line; signalName: "colorChanged"} diff --git a/tests/auto/declarative_ui/tst_map_item_details.qml b/tests/auto/declarative_ui/tst_map_item_details.qml index 1a44f0a5..12f33e8c 100644 --- a/tests/auto/declarative_ui/tst_map_item_details.qml +++ b/tests/auto/declarative_ui/tst_map_item_details.qml @@ -183,12 +183,12 @@ Item { MapRoute { id: extMapRouteDateline line.color: 'yellow' - route: Route { + route: ({ path: [ { latitude: 25, longitude: 175 }, { latitude: 20, longitude: -175 } ] - } + }) } MapRectangle { @@ -270,12 +270,12 @@ Item { MapRoute { id: extMapRouteEdge line.color: 'yellow' - route: Route { + route: ({ path: [ { latitude: 25, longitude: -15 }, { latitude: 20, longitude: -5 } ] - } + }) } Map { diff --git a/tests/auto/declarative_ui/tst_map_item_fit_viewport.qml b/tests/auto/declarative_ui/tst_map_item_fit_viewport.qml index 310b4130..2e87a416 100644 --- a/tests/auto/declarative_ui/tst_map_item_fit_viewport.qml +++ b/tests/auto/declarative_ui/tst_map_item_fit_viewport.qml @@ -202,13 +202,13 @@ Item { id: preMapRoute line.color: 'yellow' // don't try this at home - route is not user instantiable - route: Route { + route: ({ path: [ { latitude: 25, longitude: 14 }, { latitude: 20, longitude: 18 }, { latitude: 15, longitude: 15 } ] - } + }) SignalSpy {id: preMapRouteRouteChanged; target: parent; signalName: "routeChanged"} SignalSpy {id: preMapRouteLineWidthChanged; target: parent.line; signalName: "widthChanged"} SignalSpy {id: preMapRouteLineColorChanged; target: parent.line; signalName: "colorChanged"} |