summaryrefslogtreecommitdiff
path: root/tests/auto/declarative_ui/tst_map_itemview.qml
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2012-07-27 12:58:48 +1000
committerQt by Nokia <qt-info@nokia.com>2012-08-24 05:28:08 +0200
commit1549d59e448550f05c5bd1ea6a9da5d1e78c7f26 (patch)
treea4163bbe7adcb9eeec31d8d9b12399f2cd3cb5cc /tests/auto/declarative_ui/tst_map_itemview.qml
parent5c8ad55eefd482bdb91d314502289df82c1bc9ad (diff)
downloadqtlocation-1549d59e448550f05c5bd1ea6a9da5d1e78c7f26.tar.gz
Convert Coordinate into a QML coordinate value type.
This replaces the Coordinate QML element with a value type. A value type is a better fit for a coordinate. It is very similar to a vector3d except it has an explicit coordinate system and some utility functions. Declare QGeoCoordinate as a movable type. Update documentation. Change-Id: I758fa9dfd7154a4d60fb791fe553b9fee3164c2c Reviewed-by: abcd <amos.choy@nokia.com>
Diffstat (limited to 'tests/auto/declarative_ui/tst_map_itemview.qml')
-rw-r--r--tests/auto/declarative_ui/tst_map_itemview.qml58
1 files changed, 28 insertions, 30 deletions
diff --git a/tests/auto/declarative_ui/tst_map_itemview.qml b/tests/auto/declarative_ui/tst_map_itemview.qml
index 239b3856..d1566e81 100644
--- a/tests/auto/declarative_ui/tst_map_itemview.qml
+++ b/tests/auto/declarative_ui/tst_map_itemview.qml
@@ -50,7 +50,8 @@ Item {
height: 350
// General-purpose elements for the test:
Plugin { id: testPlugin; name : "qmlgeo.test.plugin"; allowExperimental: true }
- Coordinate{ id: mapDefaultCenter; latitude: 10; longitude: 30}
+
+ property variant mapDefaultCenter: QtLocation.coordinate(10, 30)
Map {
id: map
@@ -82,9 +83,9 @@ Item {
delegate: Component {
MapCircle {
radius: 1500000
- center: Coordinate {
- latitude: modeldata.coordinate.latitude;
- longitude: modeldata.coordinate.longitude;
+ center {
+ latitude: modeldata.coordinate.latitude
+ longitude: modeldata.coordinate.longitude
}
}
}
@@ -170,11 +171,11 @@ Item {
}
RouteQuery {id: routeQuery;
waypoints: [
- Coordinate {id: fcoordinate1; latitude: 60; longitude: 60},
- Coordinate {id: fcoordinate2; latitude: 61; longitude: 62},
- Coordinate {id: fcoordinate3; latitude: 63; longitude: 64},
- Coordinate {id: fcoordinate4; latitude: 65; longitude: 66},
- Coordinate {id: fcoordinate5; latitude: 67; longitude: 68}
+ { latitude: 60, longitude: 60 },
+ { latitude: 61, longitude: 62 },
+ { latitude: 63, longitude: 64 },
+ { latitude: 65, longitude: 66 },
+ { latitude: 67, longitude: 68 }
]
}
@@ -199,9 +200,9 @@ Item {
id: theItemViewsComponent
MapCircle {
radius: 1500000
- center: Coordinate {
- latitude: modeldata.coordinate.latitude;
- longitude: modeldata.coordinate.longitude;
+ center {
+ latitude: modeldata.coordinate.latitude
+ longitude: modeldata.coordinate.longitude
}
}
}
@@ -214,16 +215,9 @@ Item {
plugin: testPlugin;
anchors.fill: parent;
zoomLevel: 2
- Coordinate {
- id: firstItemCoord
- latitude: 11
- longitude: 31
- }
- Coordinate {
- id: secondItemCoord
- latitude: 12
- longitude: 32
- }
+
+ property variant firstItemCoord: QtLocation.coordinate(11, 31)
+ property variant secondItemCoord: QtLocation.coordinate(12, 32)
MapItemView {
id: listModelItemView
@@ -236,9 +230,9 @@ Item {
delegate: Component {
MapCircle {
radius: 1500000
- center: Coordinate {
- latitude: lat;
- longitude: lon;
+ center {
+ latitude: lat
+ longitude: lon
}
}
}
@@ -344,7 +338,7 @@ Item {
compare(dynamicMap2.mapItems.length, 0)
// create and destroy a dynamic item that is in the map
- var dynamicCircle = Qt.createQmlObject('import QtQuick 2.0; import QtLocation 5.0; MapCircle { objectName: \'dynamic circle 1\'; center: Coordinate { latitude: 5; longitude: 5 } radius: 15 } ', masterItem, "dynamicCreationErrors" );
+ var dynamicCircle = Qt.createQmlObject('import QtQuick 2.0; import QtLocation 5.0; MapCircle { objectName: \'dynamic circle 1\'; center { latitude: 5; longitude: 5 } radius: 15 } ', masterItem, "dynamicCreationErrors" );
verify (dynamicCircle !== null)
compare(map.mapItems.length, 0)
map.addMapItem(dynamicCircle)
@@ -403,12 +397,16 @@ Item {
function test_listmodel() {
compare(mapForTestingListModel.mapItems.length, 3);
- compare(mapForTestingListModel.mapItems[0].center.longitude, firstItemCoord.longitude);
- compare(mapForTestingListModel.mapItems[0].center.latitude, firstItemCoord.latitude);
+ compare(mapForTestingListModel.mapItems[0].center.longitude,
+ mapForTestingListModel.firstItemCoord.longitude);
+ compare(mapForTestingListModel.mapItems[0].center.latitude,
+ mapForTestingListModel.firstItemCoord.latitude);
testingListModel.remove(0);
compare(mapForTestingListModel.mapItems.length, 2);
- compare(mapForTestingListModel.mapItems[0].center.longitude, secondItemCoord.longitude);
- compare(mapForTestingListModel.mapItems[0].center.latitude, secondItemCoord.latitude);
+ compare(mapForTestingListModel.mapItems[0].center.longitude,
+ mapForTestingListModel.secondItemCoord.longitude);
+ compare(mapForTestingListModel.mapItems[0].center.latitude,
+ mapForTestingListModel.secondItemCoord.latitude);
testingListModel.append({ lat: 1, lon: 1 });
compare(mapForTestingListModel.mapItems.length, 3);
compare(mapForTestingListModel.mapItems[2].center.latitude, 1);