Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5.6, 6.8.0
-
Visual C++ 2022, Windows 10
-
-
9d3488b3c (dev), 427e7ac9d (6.8), 9fd43c27d (dev), a5a54c083 (6.8), b55991793 (tqtc/lts-6.5), 4a55dde38 (dev), 3537f7450 (6.8)
Description
NOTE!
Similar bug exists ( QTBUG-106563 ) but this is not a duplicate as the example application from that bug works correctly with 6.5.6 and 6.8.0, whereas the application provided here does not.
Description:
In the attached application, open the Drawer, click on button to open the context menu and then click on the second (disabled) MenuItem. The item in underlying list view catches the click, not the menu item.
The problem seems to be related to the fact that the menu is in a Drawer. The problem was not seen in context menus outside the drawer.
pragma ComponentBehavior: Bound import QtQuick import QtQuick.Controls Window { id: _mainWindow width: 640 height: 480 visible: true title: qsTr("Click The Context Menu") Button { anchors.centerIn: parent text: "Click to open drawer" onClicked: _drawer.open() } Drawer { id: _drawer edge: Qt.RightEdge width: _mainWindow.width / 3 height: _mainWindow.height Rectangle { id: _flickableContent color: "white" height: parent.height width: _drawer.width Button { id: _popupOpenButton property int clicks: 0 anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top anchors.topMargin: 5 text: qsTr("Click to open context menu (%1)").arg(clicks) onClicked: { clicks = 0 _popup.open() } Menu { id: _popup x: 0 y: _popupOpenButton.implicitHeight width: parent.width - 10 MenuItem { text: "Menu first" onTriggered: _popupOpenButton.clicks += 10 } MenuItem { text: "Click me" enabled: false onTriggered: _popupOpenButton.clicks += 20 } MenuItem { text: "Menu third" onTriggered: _popupOpenButton.clicks += 30 } } } ListView { anchors.top: _popupOpenButton.bottom anchors.topMargin: 5 anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom model: ["first", "second", "third"] delegate: Rectangle { color: _mouseArea.containsMouse ? "lightgray" : "white" width: parent.width - 10 height: 25 border.width: 1 border.color: "black" anchors.horizontalCenter: parent.horizontalCenter required property var model required property int index Label { anchors.centerIn: parent text: model.modelData } MouseArea { id: _mouseArea hoverEnabled: true anchors.fill: parent onPressed: _popupOpenButton.clicks += (index + 1) } } } } } }
Attachments
Issue Links
- relates to
-
QTBUG-106563 Disabled MenuItem propagates click to underlying elements
-
- Closed
-
-
QTBUG-104323 Not possible to close a modal ComboBox popup by clicking on the ComboBox
-
- Closed
-
- mentioned in
-
Page Loading...