Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.2.2, 6.2.3
-
None
Description
When a DragHandler is used inside a Button, its active property does not change when dragging starts.
In the example qml code below, the steelblue Rectangle cannot be dragged from the Button because the active property of the DragHandler does not change. If the Button is replaced with a Rectangle, everything works as expected.
Regression: worked with Qt 5.15.2
import QtQuick 2.15 import QtQuick.Window 2.0 import QtQuick.Controls 2.15 Window { id: window width: 1000 height: 1000 visible: true Rectangle { id: area color: "lightgrey" anchors.centerIn: parent width: 900 height: 900 Rectangle { width: 50 height: width color: dragHandler.active ? "red" : "lightblue" } Button { // no problem if this is a Rectangle width: 40 height: 40 anchors {left: parent.left; verticalCenter: parent.verticalCenter} Rectangle { id: icon color: "steelblue" width: parent.width / 2 height: width Drag.active: dragHandler.active Drag.hotSpot.x: dragHandler.centroid.pressPosition.x Drag.hotSpot.y: dragHandler.centroid.pressPosition.y states: [ State { when: !icon.Drag.active AnchorChanges { target: icon anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter } } ] } DragHandler { id: dragHandler target: icon } } } DropArea { anchors.fill: area } }
Attachments
Issue Links
- is duplicated by
-
QTBUG-105610 should be able to add a DragHandler to a Button or other control
- Closed