From 19f9cf8d2e3d9116aa19b1f988fc5490247add4c Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Thu, 8 Dec 2016 13:45:54 +0100 Subject: Calqlatr Example: Pass the third arg to the mapToItem() calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Topi Reiniƶ Reviewed-by: Mitch Curtis --- examples/quick/demos/calqlatr/calqlatr.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'examples/quick/demos') 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() -- cgit v1.2.3