aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/applicationwindow/data
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-07-10 16:48:07 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-07-11 09:41:13 +0000
commit744164e6c92cb721d2a339cee8c465e1685723f9 (patch)
tree680bf1ea6f68249a7985eb6a67780d0738d5c818 /tests/auto/applicationwindow/data
parentcc188f897af27daf47b0937e38ccb76ac2310abb (diff)
Fix focus handling for popups
When a popup is closed, if there are multiple popups open, restore focus to the next popup in chain instead of transferring focus to the window content. This allows us to cleanup the custom focus handling for sub-menus in dev. There is no more need to manually transfer focus to the parent menu or to a sub-menu, but calling open() or close() is enough and the focus is automatically transferred as expected. Change-Id: I54406c7c6b8dd25af261e00ebb1ae00ccbea8b9f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/applicationwindow/data')
-rw-r--r--tests/auto/applicationwindow/data/focusAfterPopupClosed.qml15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/applicationwindow/data/focusAfterPopupClosed.qml b/tests/auto/applicationwindow/data/focusAfterPopupClosed.qml
index 015e03bc..f0499a3a 100644
--- a/tests/auto/applicationwindow/data/focusAfterPopupClosed.qml
+++ b/tests/auto/applicationwindow/data/focusAfterPopupClosed.qml
@@ -57,9 +57,12 @@ ApplicationWindow {
visible: true
signal focusScopeKeyPressed
+ signal focusPopupKeyPressed
+ property alias fileMenu: fileMenu
property alias toolButton: toolButton
property alias focusScope: focusScope
+ property alias focusPopup: focusPopup
header: ToolBar {
ToolButton {
@@ -92,5 +95,17 @@ ApplicationWindow {
Keys.onSpacePressed: focusScopeKeyPressed()
}
+
+ Popup {
+ id: focusPopup
+ focus: true
+ width: parent.width
+ height: parent.height
+
+ Item {
+ focus: true
+ Keys.onSpacePressed: focusPopupKeyPressed()
+ }
+ }
}