summaryrefslogtreecommitdiff
path: root/src/controls/Private
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@theqtcompany.com>2016-03-09 13:10:35 +0100
committerShawn Rutledge <shawn.rutledge@theqtcompany.com>2016-03-11 14:12:20 +0000
commit101c1c5e466befc8f58f2eca35265dd32ea9f66a (patch)
treee6932c9e4603e17da88f9a487ab1af0e29efbac3 /src/controls/Private
parent44b8cbe43ca246ee52327dac19c44d358f233e66 (diff)
downloadqtquickcontrols-101c1c5e466befc8f58f2eca35265dd32ea9f66a.tar.gz
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 <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/controls/Private')
-rw-r--r--src/controls/Private/ScrollBar.qml5
1 files changed, 4 insertions, 1 deletions
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")