summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@theqtcompany.com>2016-06-23 15:48:28 +0200
committerMichal Klocek <michal.klocek@theqtcompany.com>2016-06-24 14:10:26 +0000
commit24ecdc6c962ff40096782bffc24b7d6623c4a87e (patch)
treefbbf6a2c35a6643ea99d97729fd7f6e6bc0fd612 /tests
parent93e4645cde4ad8ca00c2bcdacd6150d80f81bc1c (diff)
downloadqtlocation-24ecdc6c962ff40096782bffc24b7d6623c4a87e.tar.gz
A fix for not working setVisibleRegion
Setting the visibleRegion, than changing the map center or zoom and than setting it again does not work. Fix the issue by invalidating the region on the zoom or center change. Task-number: QTBUG-54141 Change-Id: I4e680f146312e3a3aa90e27fae213042cc2b2a42 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative_ui/tst_map_item_fit_viewport.qml21
1 files changed, 21 insertions, 0 deletions
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 8671d05d..4cbef945 100644
--- a/tests/auto/declarative_ui/tst_map_item_fit_viewport.qml
+++ b/tests/auto/declarative_ui/tst_map_item_fit_viewport.qml
@@ -357,6 +357,27 @@ Item {
verify(!is_coord_on_screen(fitCircleBottomRight))
verify(is_coord_on_screen(fitEmptyRect.topLeft))
verify(is_coord_on_screen(fitEmptyRect.bottomRight))
+
+ // Test if this can be reset
+ map.visibleRegion = fitRect
+ verify(is_coord_on_screen(fitRect.topLeft))
+ verify(is_coord_on_screen(fitRect.bottomRight))
+ // move map
+ map.center = QtPositioning.coordinate(0,0)
+ verify(!is_coord_on_screen(fitRect.topLeft))
+ verify(!is_coord_on_screen(fitRect.bottomRight))
+ // recheck
+ map.visibleRegion = fitRect
+ verify(is_coord_on_screen(fitRect.topLeft))
+ verify(is_coord_on_screen(fitRect.bottomRight))
+ //zoom map
+ map.zoomLevel++;
+ verify(!is_coord_on_screen(fitRect.topLeft))
+ verify(!is_coord_on_screen(fitRect.bottomRight))
+ // recheck
+ map.visibleRegion = fitRect
+ verify(is_coord_on_screen(fitRect.topLeft))
+ verify(is_coord_on_screen(fitRect.bottomRight))
}
/*function test_ad_visible_items_move() {