From 1b7ac95bc0296301dee0846e0ea4381c762d8a33 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 21 Oct 2016 23:31:02 +0200 Subject: Gallery: add Escape shortcut This does not work very well, yet. The purpose is to demonstrate the lack of co-operation between of QML Shortcuts vs. QQC2 Popups. For example, the back navigation shortcut activates in the background when the modal settings dialog is open. The consequent commits are going to fix these issues step by step. Task-number: QTBUG-56562 Change-Id: Iceafc175f4da8054b65d664a3e0faf0087d0dec5 Reviewed-by: Mitch Curtis --- examples/quickcontrols2/gallery/gallery.qml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'examples') diff --git a/examples/quickcontrols2/gallery/gallery.qml b/examples/quickcontrols2/gallery/gallery.qml index cc818abd..0d1c89f0 100644 --- a/examples/quickcontrols2/gallery/gallery.qml +++ b/examples/quickcontrols2/gallery/gallery.qml @@ -57,6 +57,15 @@ ApplicationWindow { property string style: "Default" } + Shortcut { + sequence: "Esc" + enabled: stackView.depth > 1 + onActivated: { + stackView.pop() + listView.currentIndex = -1 + } + } + header: ToolBar { Material.foreground: "white" -- cgit v1.2.3