Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.8.0 Alpha
-
None
-
c4eefa4a8d6d3e95062deb78229940460a7ef605
Description
I have a shortcut "editor" item in a popup. When editing a shortcut, the item has focus, as it needs to process the key events. If the user wants to abort editing of the shortcut, they should be able to press escape to do so. The problem is that Popup grabs the escape shortcut, so that the popup always closes on the first escape press, instead of the second:
import QtQuick 2.5 import QtQuick.Window 2.2 import QtQuick.Controls 2.1 Window { id: window visible: true width: 400 height: 400 Popup { id: popup width: 400 height: 400 contentItem: Rectangle { id: keySequenceEditor focus: true color: "salmon" Keys.onEscapePressed: { focus = false // Popup shouldn't close event.accepted = true } } } Button { objectName: "Button" text: "open" onClicked: popup.open() } }
This is probably caused by b31b4094e1728d839fef30f5128c81451ea75e4a, so I'd imagine it's an issue in 5.7 as well.
Attachments
For Gerrit Dashboard: QTBUG-57098 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
177415,8 | Keys: add shortcutOverride signal | dev | qt/qtdeclarative | Status: MERGED | -2 | 0 |
180302,1 | Keys: add shortcutOverride signal | wip/scenegraphng | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
386671,3 | Doc: explain how to handle Escape/Back in Popup | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
387726,2 | Doc: explain how to handle Escape/Back in Popup | 6.3 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
387727,2 | Doc: explain how to handle Escape/Back in Popup | 6.2 | qt/qtdeclarative | Status: MERGED | +2 | 0 |