summaryrefslogtreecommitdiffstats
path: root/examples/declarative/mapviewer/Marker.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/mapviewer/Marker.qml')
-rw-r--r--examples/declarative/mapviewer/Marker.qml5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/declarative/mapviewer/Marker.qml b/examples/declarative/mapviewer/Marker.qml
index c745ee09..bd68b77f 100644
--- a/examples/declarative/mapviewer/Marker.qml
+++ b/examples/declarative/mapviewer/Marker.qml
@@ -63,6 +63,7 @@ import "common" as Common
property int dY: 0
property int lastX: -1
property int lastY: -1
+ property bool longPress: false
hoverEnabled: true
onPressed: {
marker.z++
@@ -83,12 +84,13 @@ import "common" as Common
onReleased: {
if (markerTimer.running) markerTimer.stop();
marker.z--
+ longPress = false
}
onPositionChanged: {
var newX, newY
if (markerTimer.running) markerTimer.stop();
- if (mouse.button == Qt.LeftButton){
+ if ((mouse.button == Qt.LeftButton) && (longPress != true)){
lastX = mouse.x
lastY = mouse.y
newX = map.toScreenPosition(mouse.coordinate).x + dX
@@ -105,6 +107,7 @@ import "common" as Common
running: false
repeat: false
onTriggered: {
+ markerMouseArea.longPress = true
map.markerLongPress()
}
}