From 24ecdc6c962ff40096782bffc24b7d6623c4a87e Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Thu, 23 Jun 2016 15:48:28 +0200 Subject: 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 --- .../declarative_ui/tst_map_item_fit_viewport.qml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests/auto/declarative_ui/tst_map_item_fit_viewport.qml') 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() { -- cgit v1.2.1