From 9bde8dc3e8dc853959895e653a41bf6ed3a67f95 Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Mon, 26 Sep 2022 11:36:14 +0200 Subject: [PATCH] QmlDesigner: Fix dragging while scrolling Task-number: QDS-7744 Change-Id: I99de01a09ef939e506c07d411c42bd2b28a53c31 Reviewed-by: Thomas Hartmann Reviewed-by: Brook Cronin --- share/qtcreator/qmldesigner/newstateseditor/Main.qml | 4 ++++ .../qtcreator/qmldesigner/newstateseditor/StateThumbnail.qml | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/qmldesigner/newstateseditor/Main.qml b/share/qtcreator/qmldesigner/newstateseditor/Main.qml index f38baa7bd4a..9bc9e6eb4b3 100644 --- a/share/qtcreator/qmldesigner/newstateseditor/Main.qml +++ b/share/qtcreator/qmldesigner/newstateseditor/Main.qml @@ -526,6 +526,7 @@ Rectangle { anchors.leftMargin: root.leftMargin ScrollBar.horizontal: StateScrollBar { + id: horizontalBar parent: scrollView x: scrollView.leftPadding y: scrollView.height - height @@ -534,6 +535,7 @@ Rectangle { } ScrollBar.vertical: StateScrollBar { + id: verticalBar parent: scrollView x: scrollView.mirrored ? 0 : scrollView.width - width y: scrollView.topPadding @@ -763,6 +765,8 @@ Rectangle { hasWhenCondition: delegateRoot.hasWhenCondition + scrollViewActive: horizontalBar.active || verticalBar.active + dragParent: scrollView // Fix ScrollView taking over the dragging event diff --git a/share/qtcreator/qmldesigner/newstateseditor/StateThumbnail.qml b/share/qtcreator/qmldesigner/newstateseditor/StateThumbnail.qml index ee1ea8132a4..ce95aa21983 100644 --- a/share/qtcreator/qmldesigner/newstateseditor/StateThumbnail.qml +++ b/share/qtcreator/qmldesigner/newstateseditor/StateThumbnail.qml @@ -55,6 +55,8 @@ Item { property bool hasWhenCondition: false + property bool scrollViewActive: false + property Item dragParent property int visualIndex: 0 @@ -89,7 +91,7 @@ Item { DragHandler { id: dragHandler - enabled: !root.baseState && !root.extendedState + enabled: !root.baseState && !root.extendedState && !root.scrollViewActive onGrabChanged: function (transition, point) { if (transition === PointerDevice.GrabPassive || transition === PointerDevice.GrabExclusive)