Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.15.2
-
Tested only on Linux desktop (F33 w/wayland) but assume this will affect at least all desktop platforms.
-
-
40bbf1e8fddebb0974426a03b0f48dfc08f942de (qt/qtdeclarative/dev) 42ae5a32eb384cb7042eeace193aa42637970387 (qt/qtdeclarative/6.1)
Description
In this code, a WheelHandler shall be deactivated as long as the DragHandler is active. While the enabled property is correctly set to false when the drag starts, it is magically re-enabled once the wheel has been used.
How the example code produces the wrong behavior:
1. Start dragging the purple rectangle (this disables the WheelHandler).
2. While still dragging, move the mouse wheel.
Expected: The WheelHandler does nothing, because it is disabled. The wheel signal should not be sent.
Is: The WheelHandler is somehow enabled again and the wheel signal fired.
The issue does not occur when using a static "enabled: false" in the WheelHandler, so I suspect that the point in time is crucial here.
Please find a working minimal example in the attachment.
WheelHandler { id: wheelHandler enabled: !dragHandler.active target: null onWheel: appWin.scaleFactor += event.angleDelta.y / 1000 onEnabledChanged: console.log('WheelHandler enabled', wheelHandler.enabled) } DragHandler { id: dragHandler target: sampleRect onActiveChanged: console.log('DragHandler active', dragHandler.active) }