Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.5
-
None
Description
When setting enabled property to false on an active Drag handler, it won't be until the next pointer move event that the active flag will be reset. For example, if a user starts dragging an item, but then holds it still in place, and during that time enabled is assigned false somehow, then a handler would temporarily hang in an inconsistent state with enabled: false; active: true.
Expected behavior: The active property should be immediately reset to false, and any currently ongoing operations cancelled.
Reproducible snippet:
import QtQuick 2.15 import QtQuick.Window 2.15 Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Rectangle { focus: true width: 50 height: 50 color: "red" DragHandler { id: dragHandler onActiveChanged: print("DRAG ACTIVE", active, "ENABLED", enabled); onEnabledChanged: print("DRAG ENABLED", enabled, "ACTIVE", active); } Keys.onSpacePressed: dragHandler.enabled = !dragHandler.enabled; } }