summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@theqtcompany.com>2016-04-11 18:44:33 +0200
committerPaolo Angelelli <paolo.angelelli@theqtcompany.com>2016-06-28 13:22:22 +0000
commitd8623babde6117bae84dfd90c50e6241482183be (patch)
tree69fe7ec44bcad2b8536509272fdfa945a84bebf9 /tests
parent83feab53cede063b11435c6f2fe58e3c933676eb (diff)
downloadqtlocation-d8623babde6117bae84dfd90c50e6241482183be.tar.gz
Fix for wandering QGeoMapPolylineGeometry
QGeoMapPolylineGeometry is currently erratic due to the semi-randomly varying geoLeftBound, that basically defines how the line will be drawn. This patch uses a consistent way to calculate this value in all the QDeclarativeGeo-items, at coordinate-definition time. The new approach implies that each pair of points in a polyline are connected in the longitudinal direction of the shortest path. The patch attempts to optimize the common addCoordinate path by incrementally searching for the left bound. The patch also makes the other geoshapes (GeoPolygon, GeoCircle) behave in the same way. Task-number: QTBUG-43107 Task-number: QTBUG-52610 Change-Id: I7a0f6c4370fd6c50999fd2e5b1a7aa5954c8a8fc Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative_ui/tst_map_item_details.qml12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/auto/declarative_ui/tst_map_item_details.qml b/tests/auto/declarative_ui/tst_map_item_details.qml
index 68e069d4..ebaf1ea7 100644
--- a/tests/auto/declarative_ui/tst_map_item_details.qml
+++ b/tests/auto/declarative_ui/tst_map_item_details.qml
@@ -421,6 +421,8 @@ Item {
function test_dateline() {
map.center = datelineCoordinate
map.zoomLevel = 2.2
+ var inspectionTime = 0 // change this to inspect the behavior.
+
// rectangle
// item spanning across dateline
map.addMapItem(extMapRectDateline)
@@ -440,6 +442,7 @@ Item {
verify(point.x == map.width / 2.0)
// drag item back onto dateline
verify(LocationTestHelper.waitForPolished(map))
+ visualInspectionPoint(inspectionTime)
mousePress(map, point.x + 5, point.y + 5)
var i
for (i=0; i < 20; i += 2) {
@@ -448,6 +451,7 @@ Item {
}
mouseRelease(map, point.x + 5 - i, point.y + 5)
verify(LocationTestHelper.waitForPolished(map))
+ visualInspectionPoint(inspectionTime)
point = map.fromCoordinate(extMapRectDateline.topLeft)
verify(point.x < map.width / 2.0)
point = map.fromCoordinate(extMapRectDateline.bottomRight)
@@ -465,7 +469,7 @@ Item {
point = map.fromCoordinate(extMapCircleDateline.center)
verify(LocationTestHelper.waitForPolished(map))
verify(point.x > map.width / 2.0)
- visualInspectionPoint()
+ visualInspectionPoint(inspectionTime)
mousePress(map, point.x, point.y)
for (i=0; i < 50; i += 4) {
wait(1)
@@ -473,6 +477,7 @@ Item {
}
mouseRelease(map, point.x - i, point.y)
verify(LocationTestHelper.waitForPolished(map))
+ visualInspectionPoint(inspectionTime)
point = map.fromCoordinate(extMapCircleDateline.center)
visualInspectionPoint()
verify(point.x < map.width / 2.0)
@@ -489,7 +494,7 @@ Item {
point = map.fromCoordinate(extMapQuickItemDateline.coordinate)
verify(point.x > map.width / 2.0)
verify(LocationTestHelper.waitForPolished(map))
- visualInspectionPoint()
+ visualInspectionPoint(inspectionTime)
mousePress(map, point.x + 5, point.y + 5)
for (i=0; i < 64; i += 5) {
wait(1)
@@ -497,6 +502,7 @@ Item {
}
mouseRelease(map, point.x + 5 - i, point.y + 5)
verify(LocationTestHelper.waitForPolished(map))
+ visualInspectionPoint(inspectionTime)
point = map.fromCoordinate(extMapQuickItemDateline.coordinate)
visualInspectionPoint()
verify(point.x < map.width / 2.0)
@@ -534,6 +540,7 @@ Item {
point = map.fromCoordinate(extMapPolygonDateline.path[3])
verify(point.x == map.width / 2.0)
verify(LocationTestHelper.waitForPolished(map))
+ visualInspectionPoint(inspectionTime)
mousePress(map, point.x + 5, point.y - 5)
for (i=0; i < 16; i += 2) {
wait(1)
@@ -541,6 +548,7 @@ Item {
}
mouseRelease(map, point.x + 5 - i, point.y - 5)
verify(LocationTestHelper.waitForPolished(map))
+ visualInspectionPoint(inspectionTime)
point = map.fromCoordinate(extMapPolygonDateline.path[0])
verify(point.x < map.width / 2.0)
point = map.fromCoordinate(extMapPolygonDateline.path[1])