Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.6.3
-
None
Description
If a TapHandler is defined in a modal popup, and on the same coordinates another TapHandler is defined (not part of the modal popup but main window) after the tap event from the modal is emited, the TapHandler below the modal will catch the tap event aswell.
I have a code example and video that clarify the issue.
Video explanation: The blue box is only changing colors if it is clicked. The green box from the modal popup is only closing the popup. But as you can see from the video, after pressing the green button that closes the popup, the blue box changes color (which means it was pressed aswell at the same time)
import QtQuick import QtQuick.Window import QtQuick.ControlsWindow { id: window width: 640 height: 480 visible: true title: qsTr("Hello World") Popup { id: popup modal: true dim: true height: 200 width: 200 x: window.width / 2 - width / 2 y: window.height / 2 - height / 2 contentItem: Item { Rectangle { anchors.centerIn: parent height: 50 width: 50 color: "green" TapHandler { onTapped: popup.close() } } } } Rectangle { id: mainRect property bool isRed: false anchors.centerIn: parent height: 100 width: 100 color: mainRect.isRed ? "red" : "blue" TapHandler { onTapped: mainRect.isRed = !mainRect.isRed } } Button { anchors.bottom: window.bottom text: "Open popup" onClicked: popup.open() } }
Attachments
Issue Links
- clones
-
QTBUG-115141 Popup propagates TapHandler/DragHandler events
- Reported