Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
None
-
5.13.1
-
Shovelling Snow, Q1/2020 Finale, Q2/2020 kick off
Description
With multiple popups open, pressing escape will close the top one, not the one that has the active focus.
With attached example:
- press "Show dialog1"
- press "Show dialog2"
- press dialog1 so that it get active focus
- press esc
-> it closes the dialog2 instead of 1
import QtQuick 2.12 import QtQuick.Controls 2.5 import QtQuick.Window 2.12 ApplicationWindow { visible: true width: 640 height: 480 title: qsTr("QTBUG-79280") objectName: "appwin" onActiveFocusItemChanged: console.log("activeFocusItem", activeFocusItem) Row { spacing: 20 Button { text: "Show Dialog1" objectName: "button1" onClicked: dialog1.open() } Button { text: "Show Dialog2" objectName: "button2" onClicked: dialog2.open() } } Dialog { id: dialog1 objectName: "dialog1" title: "Dialog1" x: 200 y: 100 width: 200 height: 200 focus: true closePolicy: Popup.CloseOnEscape | Popup.NoAutoClose MouseArea { onClicked: forceActiveFocus() objectName: "MouseArea1" focus: true width: 200 height: 200 Text { text: parent.activeFocus ? "has active focus" : "" } Keys.onPressed: function(event) { console.log("dialog1 key pressed 0x" + event.key.toString(16)) } } } Dialog { id: dialog2 title: "Dialog2" objectName: "dialog2" x: 100 y: 200 width: 200 height: 200 focus: true closePolicy: Popup.CloseOnEscape | Popup.NoAutoClose MouseArea { objectName: "MouseArea2" onClicked: forceActiveFocus() width: 200 height: 200 Text { text: parent.activeFocus ? "has active focus" : "" } focus: true Keys.onPressed: function(event) { console.log("dialog2 key pressed 0x" + event.key.toString(16)) } } } }
Attachments
Issue Links
- resulted in
-
QTBUG-104535 REG: Android's Back button does not close QQC2 Dialogs anymore
- Closed
For Gerrit Dashboard: QTBUG-79280 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
288523,10 | WIP: QQuickPopup: add raise function | dev | qt/qtquickcontrols2 | Status: ABANDONED | -2 | 0 |
393881,3 | WIP: QQuickPopup: add raise function | dev | qt/qtdeclarative | Status: ABANDONED | -2 | 0 |
393888,8 | WIP: Give shortcuts to popup with active focus, regardless of stacking order | dev | qt/qtdeclarative | Status: ABANDONED | -2 | 0 |
397959,16 | Use regular key events for cancelling popups | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
397968,17 | Give Dialogs and Menus focus by default | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |