From 101c1c5e466befc8f58f2eca35265dd32ea9f66a Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 9 Mar 2016 13:10:35 +0100 Subject: ScrollBar: ignore synthesized mouse events This should be more reliable than trying to disable it if it is shown on a touchscreen, because it's quite possible to have both a touchscreen and a mouse. And if there is a mouse, the scrollbar should always be draggable. Task-number: QTBUG-41591 Change-Id: Iec6844d974bd58545069cff3352f0174a56847b2 Reviewed-by: Mitch Curtis --- src/controls/Private/ScrollBar.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/controls/Private') diff --git a/src/controls/Private/ScrollBar.qml b/src/controls/Private/ScrollBar.qml index d943021b..eea7a737 100644 --- a/src/controls/Private/ScrollBar.qml +++ b/src/controls/Private/ScrollBar.qml @@ -101,7 +101,6 @@ Item { onExited: if (!pressed) __panel.activeControl = "none" onMouseXChanged: if (!pressed) __panel.activeControl = __panel.hitTest(mouseX, mouseY) hoverEnabled: Settings.hoverEnabled - enabled: !Settings.isMobile || !Settings.hasTouchScreen // ### Not ideal, but will usually behave as expected... preventStealing: true property var pressedX property var pressedY @@ -140,6 +139,10 @@ Item { } onPressed: { + if (mouse.source !== Qt.MouseEventNotSynthesized) { + mouse.accepted = false + return + } __panel.activeControl = __panel.hitTest(mouseX, mouseY) scrollToClickposition = scrollToClickPosition var handleRect = __panel.subControlRect("handle") -- cgit v1.2.1