diff options
author | Paolo Angelelli <paolo.angelelli@theqtcompany.com> | 2016-05-31 16:06:02 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@theqtcompany.com> | 2016-06-02 19:25:07 +0000 |
commit | 07b9d583273b8e3aa5712eac9d06b74ddb927db3 (patch) | |
tree | 9958505c35cbe5ce6abb452555eb29099d8db8d1 /tests/auto | |
parent | ef471a0254c7c3a5978d06980f1e7e32229f21b4 (diff) | |
download | qtlocation-07b9d583273b8e3aa5712eac9d06b74ddb927db3.tar.gz |
fix for losing map item focus while dragging them
QDeclarativeGeoMapItemBase::childMouseEventFilter currently does a
contain() check on the clicks but also on the mouse move events.
by not doing it on mouse move events the problem seems fixed, but the
autotests get broken because it seems that the map doesn't get panned
anymore but the element gets dragged instead.
Task-number: QTBUG-52075
Change-Id: I5ce340ca591ec924eebed1fe7acda18d31301fc5
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative_ui/tst_map_item_details.qml | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/tests/auto/declarative_ui/tst_map_item_details.qml b/tests/auto/declarative_ui/tst_map_item_details.qml index fd9b0064..3927db69 100644 --- a/tests/auto/declarative_ui/tst_map_item_details.qml +++ b/tests/auto/declarative_ui/tst_map_item_details.qml @@ -283,7 +283,7 @@ Item { Text {id: progressText} TestCase { - name: "MapItemDeatils" + name: "MapItemDetails" when: windowShown /* @@ -464,19 +464,22 @@ Item { verify(extMapCircleDateline.center.longitude === 180) map.center = datelineCoordinate point = map.fromCoordinate(extMapCircleDateline.center) - verify(point.x == map.width / 2.0) - extMapCircleDateline.center.longitude = datelineCoordinateRight.longitude + verify(point.x == map.width / 2.0) // center of the screen + visualInspectionPoint() + extMapCircleDateline.center.longitude = datelineCoordinateRight.longitude // -170, moving the circle to the right point = map.fromCoordinate(extMapCircleDateline.center) - verify(point.x > map.width / 2.0) verify(LocationTestHelper.waitForPolished(map)) + verify(point.x > map.width / 2.0) + visualInspectionPoint() mousePress(map, point.x, point.y) - for (i=0; i < 40; i += 4) { + for (i=0; i < 50; i += 4) { wait(1) mouseMove(map, point.x - i, point.y) } mouseRelease(map, point.x - i, point.y) verify(LocationTestHelper.waitForPolished(map)) point = map.fromCoordinate(extMapCircleDateline.center) + visualInspectionPoint() verify(point.x < map.width / 2.0) map.removeMapItem(extMapCircleDateline) @@ -486,18 +489,21 @@ Item { verify(extMapQuickItemDateline.coordinate.longitude === 175) point = map.fromCoordinate(extMapQuickItemDateline.coordinate) verify(point.x < map.width / 2.0) + visualInspectionPoint() extMapQuickItemDateline.coordinate.longitude = datelineCoordinateRight.longitude point = map.fromCoordinate(extMapQuickItemDateline.coordinate) verify(point.x > map.width / 2.0) verify(LocationTestHelper.waitForPolished(map)) + visualInspectionPoint() mousePress(map, point.x + 5, point.y + 5) - for (i=0; i < 50; i += 5) { + for (i=0; i < 64; i += 5) { wait(1) mouseMove(map, point.x + 5 - i, point.y + 5 ) } mouseRelease(map, point.x + 5 - i, point.y + 5) verify(LocationTestHelper.waitForPolished(map)) point = map.fromCoordinate(extMapQuickItemDateline.coordinate) + visualInspectionPoint() verify(point.x < map.width / 2.0) map.removeMapItem(extMapQuickItemDateline) @@ -741,5 +747,15 @@ Item { console.log('map fuzzy cmp returns false for value, ref, tolerance: ' + val + ', ' + ref + ', ' + tolerance) return false; } + // call to visualInspectionPoint testcase (for dev time visual inspection) + function visualInspectionPoint(time) { + var waitTime = 0 // 300 + if (time !== undefined) + waitTime = time + if (waitTime > 0) { + console.log('halting for ' + waitTime + ' milliseconds') + wait (waitTime) + } + } } } |