From c546b09cd8bb69d4a07c9a26c907157fc9793351 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Tue, 17 Mar 2015 10:16:01 +0100 Subject: Remove obsolete calls to map.state in mapviewer example Change-Id: I6fe478f1e7fd3c243c1da9623eac0a80f693e1a8 Reviewed-by: Alex Blasche --- examples/location/mapviewer/map/MapComponent.qml | 24 +++--------------------- examples/location/mapviewer/map/Marker.qml | 1 - 2 files changed, 3 insertions(+), 22 deletions(-) (limited to 'examples/location/mapviewer') diff --git a/examples/location/mapviewer/map/MapComponent.qml b/examples/location/mapviewer/map/MapComponent.qml index 6250f6c7..fc8a8681 100644 --- a/examples/location/mapviewer/map/MapComponent.qml +++ b/examples/location/mapviewer/map/MapComponent.qml @@ -363,7 +363,6 @@ Map { value: map.zoomLevel onValueChanged: { map.zoomLevel = value - map.state="" } } @@ -458,11 +457,7 @@ Map { } onPositionChanged: { - if (Math.abs(map.pressX - parent.x- mouse.x ) > map.jitterThreshold || - Math.abs(map.pressY - parent.y -mouse.y ) > map.jitterThreshold) { - map.state = "" - } - if ((mouse.button == Qt.LeftButton) & (map.state == "")) { + if (mouse.button == Qt.LeftButton) { map.lastX = mouse.x + parent.x map.lastY = mouse.y + parent.y } @@ -526,11 +521,10 @@ Map { onPositionChanged: { if (Math.abs(map.pressX - parent.x- mouse.x ) > map.jitterThreshold || Math.abs(map.pressY - parent.y -mouse.y ) > map.jitterThreshold) { - map.state = "" if (pressed) parent.radius = parent.center.distanceTo( map.toCoordinate(Qt.point(mouse.x, mouse.y))) } - if ((mouse.button == Qt.LeftButton) & (map.state == "")) { + if (mouse.button == Qt.LeftButton) { map.lastX = mouse.x + parent.x map.lastY = mouse.y + parent.y } @@ -586,22 +580,10 @@ Map { map.pressX = mouse.x map.pressY = mouse.y lastCoordinate = map.toCoordinate(Qt.point(mouse.x, mouse.y)) - // if (mouse.button == Qt.MiddleButton) - // addMarker() } onPositionChanged: { - if (map.state != "PopupMenu" || - Math.abs(map.pressX - mouse.x ) > map.jitterThreshold || - Math.abs(map.pressY - mouse.y ) > map.jitterThreshold) { - map.state = "" - } - if ((mouse.button == Qt.LeftButton) & (map.state == "")) { - // if ((map.lastX != -1) && (map.lastY != -1)) { - // var dx = mouse.x - map.lastX - // var dy = mouse.y - map.lastY - // map.pan(-dx, -dy) - // } + if (mouse.button == Qt.LeftButton) { map.lastX = mouse.x map.lastY = mouse.y } diff --git a/examples/location/mapviewer/map/Marker.qml b/examples/location/mapviewer/map/Marker.qml index 7b123ea6..33213b82 100644 --- a/examples/location/mapviewer/map/Marker.qml +++ b/examples/location/mapviewer/map/Marker.qml @@ -78,7 +78,6 @@ MapQuickItem { break } } - map.state = "" } onPressAndHold:{ -- cgit v1.2.3