Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.2.4, 6.5.3, 6.8.3, 6.9.0 RC
-
None
Description
dim property affects mouse events propagations but it shouldn't
Sample code:
import QtQuick import QtQuick.Controls Window { width: 640 height: 480 visible: true Menu { id: contextMenu MenuItem { text: "Cut" } MenuItem { text: "Copy" } MenuItem { text: "Paste" } modal: true dim: false // this affects mouse events propagation, but it shouldn't } Rectangle { id: r anchors.fill: parent TapHandler { acceptedButtons: Qt.LeftButton | Qt.RightButton onTapped: (event, button) => { if (button === Qt.LeftButton) r.color = Qt.rgba(Math.random(1), Math.random(1), Math.random(1), 1) else contextMenu.popup() } } } }
Steps to reproduce:
1. build and run sample
2. click right button - menu is opened
3. click left button outside menu - menu is closed, but click is also propagated to underlying item
Pay attention that modal is set to true for the Menu, so according to documentation https://doc.qt.io/qt-6/qml-qtquick-controls2-popup.html#modal-prop it shouldn't propagate mouse events to underlying items.
Modal popups often have a distinctive background dimming effect defined in Overlay.modal, and do not allow press or release events through to items beneath them. For example, if the user accidentally clicks outside of a popup, any item beneath that popup at the location of the click will not receive the event.
But if user wants modal Menu without background dimming effect, and forces dim property to false, mouse events start propagating, but they shouldn't as Menu is modal.
Attachments
Issue Links
- relates to
-
QTBUG-60405 Presses and releases leak through modal Menu
-
- Closed
-