aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols2/gallery/gallery.qml
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-06 13:31:44 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-06 13:31:45 +0200
commit3703d57161dc4ad7df000403bfcc43ac78eb6617 (patch)
tree4ab8ca921336f38ca539b699c6f4c0d7dc3de949 /examples/quickcontrols2/gallery/gallery.qml
parent94fdd09199b3373bc6d6e9d9c873cd16d54184a5 (diff)
parent567a5cf69ef39ba5e9d0558ee7d6caec4d69bf71 (diff)
Merge remote-tracking branch 'origin/5.13' into 5.14
Diffstat (limited to 'examples/quickcontrols2/gallery/gallery.qml')
-rw-r--r--examples/quickcontrols2/gallery/gallery.qml41
1 files changed, 24 insertions, 17 deletions
diff --git a/examples/quickcontrols2/gallery/gallery.qml b/examples/quickcontrols2/gallery/gallery.qml
index e9f0b432..44987ada 100644
--- a/examples/quickcontrols2/gallery/gallery.qml
+++ b/examples/quickcontrols2/gallery/gallery.qml
@@ -70,15 +70,31 @@ ApplicationWindow {
Shortcut {
sequences: ["Esc", "Back"]
enabled: stackView.depth > 1
- onActivated: {
- stackView.pop()
- listView.currentIndex = -1
+ onActivated: navigateBackAction.trigger()
+ }
+
+ Action {
+ id: navigateBackAction
+ icon.name: stackView.depth > 1 ? "back" : "drawer"
+ onTriggered: {
+ if (stackView.depth > 1) {
+ stackView.pop()
+ listView.currentIndex = -1
+ } else {
+ drawer.open()
+ }
}
}
Shortcut {
sequence: "Menu"
- onActivated: optionsMenu.open()
+ onActivated: optionsMenuAction.trigger()
+ }
+
+ Action {
+ id: optionsMenuAction
+ icon.name: "menu"
+ onTriggered: optionsMenu.open()
}
header: ToolBar {
@@ -89,15 +105,7 @@ ApplicationWindow {
anchors.fill: parent
ToolButton {
- icon.name: stackView.depth > 1 ? "back" : "drawer"
- onClicked: {
- if (stackView.depth > 1) {
- stackView.pop()
- listView.currentIndex = -1
- } else {
- drawer.open()
- }
- }
+ action: navigateBackAction
}
Label {
@@ -111,19 +119,18 @@ ApplicationWindow {
}
ToolButton {
- icon.name: "menu"
- onClicked: optionsMenu.open()
+ action: optionsMenuAction
Menu {
id: optionsMenu
x: parent.width - width
transformOrigin: Menu.TopRight
- MenuItem {
+ Action {
text: "Settings"
onTriggered: settingsDialog.open()
}
- MenuItem {
+ Action {
text: "About"
onTriggered: aboutDialog.open()
}