Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.7.2
-
None
Description
Given the following code
import QtQuick import QtQuick.Controls ApplicationWindow { width: 640 height: 480 visible: true title: qsTr("Hello World") Button { text: "Open popup" onClicked: dialog.open() Dialog { id: dialog modal: true parent: Overlay.overlay anchors.centerIn: parent Row { Button { id: checkbox checkable: true text: checked ? "menu.popup()" : "menu.open()" } TextArea { text: "Open menu" Menu { id: menu Action { text: "Action 1" } Action { text: "Action 2" } } onPressed: event => { if (checkbox.checked) menu.popup(event.x, event.y); else { menu.open(); } } } } } } }
When the menu is opened using menu.open() pressing Esc twice first closes the menu and then the dialog.
When using menu.popup() pressing Esc twice first closes the dialog and then the menu.
Using
menu.x = event.x; menu.y = event.y; menu.open();
hase the same effect as using menu.popup().