Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15, 6.3.0 Alpha
-
None
-
I've tested this with Qt 5.15.2 and Qt 6.3.0 Alpha on Linux and Windows. On Qt 6.3.0, the situation is slightly better since the image is dragged by a small amount and then stops.
Description
In the following code we have a dialog over an Image with a DragHandler:
import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.15 Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Image{ width: 1000 height: 600 source: "https://testimages.org/img/testimages_screenshot.jpg" DragHandler{ grabPermissions: PointerHandler.CanTakeOverFromHandlersOfSameType } } Dialog{ id: randomDialog title: "Random dialog" standardButtons: Dialog.Cancel | Dialog.Ok anchors.centerIn: parent closePolicy: Dialog.CloseOnEscape clip: true modal: true width: 500; height: 500 GridView{ anchors.centerIn: parent width: 400; height: 400 model: 100 delegate: Rectangle{ width: 400 height: 400 Label{text: index;} TapHandler{ id: tapHandler } } } } Component.onCompleted: randomDialog.open() }
If you run the code, open the dialog and drag the list in short busts inside the dialog, you'll see that the image underneath is also moving. If you remove the TapHandler (or use MouseArea instead) from the delegates, then the code behaves as expected: the image underneath is not dragged while flicking the list. It seems that DragHandler is weirdly stealing the input events from the TapHandler. This behaviour practically makes TapHandler quite hard to use inside dialog. Also if you replace the Image with a Flickable, the situation is even worse.
Attachments
Issue Links
- relates to
-
QTBUG-101398 grabPermissions cannot prevent an Item stealing grab from a handler in Qt 6
- Reported
-
QTBUG-103518 QML WebView scrolling events are picked up by DragHandler and Flickables behind it
- Closed
-
QTBUG-87815 DragHandler events are caught through popups
- Open
Gerrit Reviews
For Gerrit Dashboard: QTBUG-100104 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
223138,21 | WIP Add Item modal property | dev | qt/qtdeclarative | Status: NEW | -2 | 0 |