diff options
author | Alex Wilson <alex.wilson@nokia.com> | 2012-01-09 09:58:20 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-10 03:55:28 +0100 |
commit | d5ec0f0936f236243450a7327047369209679cf7 (patch) | |
tree | c6b8dfc0f3387e9210ec3c2c89daf009194bd2c1 /tests | |
parent | 9edac3a903e645267bb713c45933095596d1b5e9 (diff) | |
download | qtlocation-d5ec0f0936f236243450a7327047369209679cf7.tar.gz |
Renames MapPinch => MapPinchArea, adds docs for it and MapFlickable
Change-Id: Iad08ce86cf620999178dc3a00786ade980144f7f
Reviewed-by: David Laing <david.laing@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/applications/declarative_map/map3d.qml | 28 | ||||
-rw-r--r-- | tests/applications/declarative_map/map3d_mousetest.qml | 28 | ||||
-rw-r--r-- | tests/auto/declarative_ui/tst_map_pinch_and_flick.qml | 34 |
3 files changed, 45 insertions, 45 deletions
diff --git a/tests/applications/declarative_map/map3d.qml b/tests/applications/declarative_map/map3d.qml index ce434e1f..f477df9a 100644 --- a/tests/applications/declarative_map/map3d.qml +++ b/tests/applications/declarative_map/map3d.qml @@ -830,8 +830,8 @@ Rectangle { height: 1000 zoomLevel: 9 - // pinch.activeGestures: MapPinch.ZoomGesture | RotationGesture - pinch.activeGestures: MapPinch.NoGesture + // pinch.activeGestures: MapPinchArea.ZoomGesture | RotationGesture + pinch.activeGestures: MapPinchArea.NoGesture pinch.enabled: true pinch.maximumZoomLevelChange: 4.0 // maximum zoomlevel changes per pinch pinch.rotationFactor: 1.0 // default ~follows angle between fingers @@ -930,42 +930,42 @@ Rectangle { } } Rectangle { id: rowRectPinchGen; width: rowRect1.width; height: rowRect1.height; color: 'lightsteelblue'; - Text { text: "Pinch\nzoom:\n" + ((map.pinch.activeGestures & MapPinch.ZoomGesture) > 0? "Yes":"No")} + Text { text: "Pinch\nzoom:\n" + ((map.pinch.activeGestures & MapPinchArea.ZoomGesture) > 0? "Yes":"No")} MouseArea { anchors.fill: parent; onClicked: { console.log('map pinch active gestures' + map.pinch.activeGestures); - if (map.pinch.activeGestures & MapPinch.ZoomGesture) - map.pinch.activeGestures &= ~MapPinch.ZoomGesture + if (map.pinch.activeGestures & MapPinchArea.ZoomGesture) + map.pinch.activeGestures &= ~MapPinchArea.ZoomGesture else - map.pinch.activeGestures += MapPinch.ZoomGesture + map.pinch.activeGestures += MapPinchArea.ZoomGesture } } } Rectangle { width: rowRect1.width; height: rowRect1.height; color: rowRectPinchGen.color; - Text { text: "Pinch\nrotation:\n" + ((map.pinch.activeGestures & MapPinch.RotationGesture) > 0? "Yes":"No")} + Text { text: "Pinch\nrotation:\n" + ((map.pinch.activeGestures & MapPinchArea.RotationGesture) > 0? "Yes":"No")} MouseArea { anchors.fill: parent; onClicked: { console.log('map pinch active gestures' + map.pinch.activeGestures); - if (map.pinch.activeGestures & MapPinch.RotationGesture) - map.pinch.activeGestures &= ~MapPinch.RotationGesture + if (map.pinch.activeGestures & MapPinchArea.RotationGesture) + map.pinch.activeGestures &= ~MapPinchArea.RotationGesture else - map.pinch.activeGestures += MapPinch.RotationGesture + map.pinch.activeGestures += MapPinchArea.RotationGesture } } } Rectangle { width: rowRect1.width; height: rowRect1.height; color: rowRectPinchGen.color; - Text { text: "Pinch\ntilt:\n" + ((map.pinch.activeGestures & MapPinch.TiltGesture) > 0? "Yes":"No")} + Text { text: "Pinch\ntilt:\n" + ((map.pinch.activeGestures & MapPinchArea.TiltGesture) > 0? "Yes":"No")} MouseArea { anchors.fill: parent; onClicked: { console.log('map pinch active gestures' + map.pinch.activeGestures); - if (map.pinch.activeGestures & MapPinch.TiltGesture) - map.pinch.activeGestures &= ~MapPinch.TiltGesture + if (map.pinch.activeGestures & MapPinchArea.TiltGesture) + map.pinch.activeGestures &= ~MapPinchArea.TiltGesture else - map.pinch.activeGestures += MapPinch.TiltGesture + map.pinch.activeGestures += MapPinchArea.TiltGesture } } diff --git a/tests/applications/declarative_map/map3d_mousetest.qml b/tests/applications/declarative_map/map3d_mousetest.qml index ec1ae463..6c7463c1 100644 --- a/tests/applications/declarative_map/map3d_mousetest.qml +++ b/tests/applications/declarative_map/map3d_mousetest.qml @@ -306,8 +306,8 @@ Item { height: 800 zoomLevel: 5.1 - // pinch.activeGestures: MapPinch.ZoomGesture | RotationGesture - pinch.activeGestures: MapPinch.NoGesture + // pinch.activeGestures: MapPinchArea.ZoomGesture | RotationGesture + pinch.activeGestures: MapPinchArea.NoGesture pinch.enabled: true @@ -793,42 +793,42 @@ Item { } } Rectangle { id: rowRectPinchGen; width: rowRect1.width; height: rowRect1.height; color: 'lightsteelblue'; - Text { text: "Pinch\nzoom:\n" + ((map.pinch.activeGestures & MapPinch.ZoomGesture) > 0? "Yes":"No")} + Text { text: "Pinch\nzoom:\n" + ((map.pinch.activeGestures & MapPinchArea.ZoomGesture) > 0? "Yes":"No")} MouseArea { anchors.fill: parent; onClicked: { console.log('oooQML: map pinch active gestures' + map.pinch.activeGestures); - if (map.pinch.activeGestures & MapPinch.ZoomGesture) - map.pinch.activeGestures &= ~MapPinch.ZoomGesture + if (map.pinch.activeGestures & MapPinchArea.ZoomGesture) + map.pinch.activeGestures &= ~MapPinchArea.ZoomGesture else - map.pinch.activeGestures += MapPinch.ZoomGesture + map.pinch.activeGestures += MapPinchArea.ZoomGesture } } } Rectangle { width: rowRect1.width; height: rowRect1.height; color: rowRectPinchGen.color; - Text { text: "Pinch\nrotation:\n" + ((map.pinch.activeGestures & MapPinch.RotationGesture) > 0? "Yes":"No")} + Text { text: "Pinch\nrotation:\n" + ((map.pinch.activeGestures & MapPinchArea.RotationGesture) > 0? "Yes":"No")} MouseArea { anchors.fill: parent; onClicked: { console.log('oooQML: map pinch active gestures' + map.pinch.activeGestures); - if (map.pinch.activeGestures & MapPinch.RotationGesture) - map.pinch.activeGestures &= ~MapPinch.RotationGesture + if (map.pinch.activeGestures & MapPinchArea.RotationGesture) + map.pinch.activeGestures &= ~MapPinchArea.RotationGesture else - map.pinch.activeGestures += MapPinch.RotationGesture + map.pinch.activeGestures += MapPinchArea.RotationGesture } } } Rectangle { width: rowRect1.width; height: rowRect1.height; color: rowRectPinchGen.color; - Text { text: "Pinch\ntilt:\n" + ((map.pinch.activeGestures & MapPinch.TiltGesture) > 0? "Yes":"No")} + Text { text: "Pinch\ntilt:\n" + ((map.pinch.activeGestures & MapPinchArea.TiltGesture) > 0? "Yes":"No")} MouseArea { anchors.fill: parent; onClicked: { console.log('oooQML: map pinch active gestures' + map.pinch.activeGestures); - if (map.pinch.activeGestures & MapPinch.TiltGesture) - map.pinch.activeGestures &= ~MapPinch.TiltGesture + if (map.pinch.activeGestures & MapPinchArea.TiltGesture) + map.pinch.activeGestures &= ~MapPinchArea.TiltGesture else - map.pinch.activeGestures += MapPinch.TiltGesture + map.pinch.activeGestures += MapPinchArea.TiltGesture } } diff --git a/tests/auto/declarative_ui/tst_map_pinch_and_flick.qml b/tests/auto/declarative_ui/tst_map_pinch_and_flick.qml index abfb2263..d51b8f45 100644 --- a/tests/auto/declarative_ui/tst_map_pinch_and_flick.qml +++ b/tests/auto/declarative_ui/tst_map_pinch_and_flick.qml @@ -165,23 +165,23 @@ Item { compare(map.pinch.active, false) - verify(map.pinch.activeGestures & MapPinch.ZoomGesture) - verify(!(map.pinch.activeGestures & MapPinch.RotationGesture)) - verify(!(map.pinch.activeGestures & MapPinch.TiltGesture)) - map.pinch.activeGestures = MapPinch.NoGesture - compare(map.pinch.activeGestures, MapPinch.NoGesture) + verify(map.pinch.activeGestures & MapPinchArea.ZoomGesture) + verify(!(map.pinch.activeGestures & MapPinchArea.RotationGesture)) + verify(!(map.pinch.activeGestures & MapPinchArea.TiltGesture)) + map.pinch.activeGestures = MapPinchArea.NoGesture + compare(map.pinch.activeGestures, MapPinchArea.NoGesture) compare(pinchActiveGesturesSpy.count, 1) - map.pinch.activeGestures = MapPinch.NoGesture - compare(map.pinch.activeGestures, MapPinch.NoGesture) + map.pinch.activeGestures = MapPinchArea.NoGesture + compare(map.pinch.activeGestures, MapPinchArea.NoGesture) compare(pinchActiveGesturesSpy.count, 1) - map.pinch.activeGestures = MapPinch.ZoomGesture | MapPinch.RotationGesture - compare(map.pinch.activeGestures, MapPinch.ZoomGesture | MapPinch.RotationGesture) + map.pinch.activeGestures = MapPinchArea.ZoomGesture | MapPinchArea.RotationGesture + compare(map.pinch.activeGestures, MapPinchArea.ZoomGesture | MapPinchArea.RotationGesture) compare(pinchActiveGesturesSpy.count, 2) - map.pinch.activeGestures = MapPinch.RotationGesture - compare(map.pinch.activeGestures, MapPinch.RotationGesture) + map.pinch.activeGestures = MapPinchArea.RotationGesture + compare(map.pinch.activeGestures, MapPinchArea.RotationGesture) compare(pinchActiveGesturesSpy.count, 3) - map.pinch.activeGestures = MapPinch.ZoomGesture - compare(map.pinch.activeGestures, MapPinch.ZoomGesture) + map.pinch.activeGestures = MapPinchArea.ZoomGesture + compare(map.pinch.activeGestures, MapPinchArea.ZoomGesture) compare(pinchActiveGesturesSpy.count, 4) /* @@ -315,7 +315,7 @@ Item { } function test_b_pinch_rotation() { - map.pinch.activeGestures = MapPinch.RotationGesture + map.pinch.activeGestures = MapPinchArea.RotationGesture map.pinch.rotationFactor = 1.0 map.zoomLevel = 8 compare(map.zoomLevel, 8) @@ -550,7 +550,7 @@ Item { } function test_pinch_zoom() { - map.pinch.activeGestures = MapPinch.ZoomGesture + map.pinch.activeGestures = MapPinchArea.ZoomGesture map.zoomLevel = 9 clear_data() // 1. typical zoom in @@ -731,7 +731,7 @@ Item { map.pinch.enabled = true // 12. check nuthin happens if no active gestures clear_data() - map.pinch.activeGestures = MapPinch.NoGesture + map.pinch.activeGestures = MapPinchArea.NoGesture pinchGenerator.pinch(Qt.point(50,50), Qt.point(0,50),Qt.point(50,50), Qt.point(100,50)); tryCompare(pinchStartedSpy, "count", 0); wait(250); @@ -739,7 +739,7 @@ Item { compare(pinchStartedSpy.count, 0); compare(map.zoomLevel, 8.5) pinchGenerator.stop() - map.pinch.activeGestures = MapPinch.ZoomGesture + map.pinch.activeGestures = MapPinchArea.ZoomGesture // 13. manually changing zoom level during active pinch zoom clear_data(); map.pinch.maximumZoomLevelChange = 2 |