QmlDesigner: Fix dragging while scrolling

Task-number: QDS-7744
Change-Id: I99de01a09ef939e506c07d411c42bd2b28a53c31
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Brook Cronin <brook.cronin@qt.io>
This commit is contained in:
Henning Gruendl
2022-09-26 11:36:14 +02:00
committed by Henning Gründl
parent e32f585fda
commit 9bde8dc3e8
2 changed files with 7 additions and 1 deletions

View File

@@ -526,6 +526,7 @@ Rectangle {
anchors.leftMargin: root.leftMargin anchors.leftMargin: root.leftMargin
ScrollBar.horizontal: StateScrollBar { ScrollBar.horizontal: StateScrollBar {
id: horizontalBar
parent: scrollView parent: scrollView
x: scrollView.leftPadding x: scrollView.leftPadding
y: scrollView.height - height y: scrollView.height - height
@@ -534,6 +535,7 @@ Rectangle {
} }
ScrollBar.vertical: StateScrollBar { ScrollBar.vertical: StateScrollBar {
id: verticalBar
parent: scrollView parent: scrollView
x: scrollView.mirrored ? 0 : scrollView.width - width x: scrollView.mirrored ? 0 : scrollView.width - width
y: scrollView.topPadding y: scrollView.topPadding
@@ -763,6 +765,8 @@ Rectangle {
hasWhenCondition: delegateRoot.hasWhenCondition hasWhenCondition: delegateRoot.hasWhenCondition
scrollViewActive: horizontalBar.active || verticalBar.active
dragParent: scrollView dragParent: scrollView
// Fix ScrollView taking over the dragging event // Fix ScrollView taking over the dragging event

View File

@@ -55,6 +55,8 @@ Item {
property bool hasWhenCondition: false property bool hasWhenCondition: false
property bool scrollViewActive: false
property Item dragParent property Item dragParent
property int visualIndex: 0 property int visualIndex: 0
@@ -89,7 +91,7 @@ Item {
DragHandler { DragHandler {
id: dragHandler id: dragHandler
enabled: !root.baseState && !root.extendedState enabled: !root.baseState && !root.extendedState && !root.scrollViewActive
onGrabChanged: function (transition, point) { onGrabChanged: function (transition, point) {
if (transition === PointerDevice.GrabPassive if (transition === PointerDevice.GrabPassive
|| transition === PointerDevice.GrabExclusive) || transition === PointerDevice.GrabExclusive)