aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-09-06 10:34:06 +0200
committerLiang Qi <liang.qi@qt.io>2019-09-06 10:34:43 +0200
commit48ce9c5c818102b3f2c92392252020c2f0f08e78 (patch)
tree02c71ac6a21a24f3f43d69b16a0bcd36496c0dc4 /examples
parent305c3cbfe3db51225ba30249cd70ed26a6c70c58 (diff)
parent742a20d0590d3a2b7d8f7e272c12124c9aba6fea (diff)
Merge "Merge remote-tracking branch 'origin/5.12' into 5.15"
Diffstat (limited to 'examples')
-rw-r--r--examples/quickcontrols2/gallery/gallery.qml41
-rw-r--r--examples/quickcontrols2/gallery/pages/TabBarPage.qml2
2 files changed, 25 insertions, 18 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()
}
diff --git a/examples/quickcontrols2/gallery/pages/TabBarPage.qml b/examples/quickcontrols2/gallery/pages/TabBarPage.qml
index 7f5cbce5..7c3cae44 100644
--- a/examples/quickcontrols2/gallery/pages/TabBarPage.qml
+++ b/examples/quickcontrols2/gallery/pages/TabBarPage.qml
@@ -74,7 +74,7 @@ Page {
width: parent.width
wrapMode: Label.Wrap
horizontalAlignment: Qt.AlignHCenter
- text: "TabBar is a bar with icons or text which allows the user"
+ text: "TabBar is a bar with icons or text which allows the user "
+ "to switch between different subtasks, views, or modes."
}