aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/demos/calqlatr
diff options
context:
space:
mode:
authorVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2016-12-08 13:45:54 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2016-12-09 06:22:45 +0000
commit19f9cf8d2e3d9116aa19b1f988fc5490247add4c (patch)
tree864adefea5881e8c01e16031041f79772b4742c8 /examples/quick/demos/calqlatr
parent96d057e6a5138918c9f8b92ce3320042fa6417fc (diff)
Calqlatr Example: Pass the third arg to the mapToItem() calls
Apparently the mapToItem version used in the example requires at least three arguments, for some reason only two were provided, the item and the mouseX coordinate. Without the third argument, mouseY coordinate, the drag operation to move the display fails with warnings on the console. Task-number: QTBUG-57514 Change-Id: If1b16c27539bd90a2d20203dedc26f11ac2a0942 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'examples/quick/demos/calqlatr')
-rw-r--r--examples/quick/demos/calqlatr/calqlatr.qml5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/quick/demos/calqlatr/calqlatr.qml b/examples/quick/demos/calqlatr/calqlatr.qml
index 81f95907a6..017d819b01 100644
--- a/examples/quick/demos/calqlatr/calqlatr.qml
+++ b/examples/quick/demos/calqlatr/calqlatr.qml
@@ -128,6 +128,7 @@ Rectangle {
height: parent.height
MouseArea {
+ id: mouseInput
property real startX: 0
property real oldP: 0
property bool rewind: false
@@ -140,7 +141,7 @@ Rectangle {
height: 50
onPositionChanged: {
var reverse = startX > window.width / 2
- var mx = mapToItem(window, mouse.x).x
+ var mx = mapToItem(window, mouseInput.mouseX, mouseInput.mouseY).x
var p = Math.abs((mx - startX) / (window.width - display.width))
if (p < oldP)
rewind = reverse ? false : true
@@ -149,7 +150,7 @@ Rectangle {
controller.progress = reverse ? 1 - p : p
oldP = p
}
- onPressed: startX = mapToItem(window, mouse.x).x
+ onPressed: startX = mapToItem(window, mouseInput.mouseX, mouseInput.mouseY).x
onReleased: {
if (rewind)
controller.completeToBeginning()