aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols/gallery/pages/StackViewPage.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quickcontrols/gallery/pages/StackViewPage.qml')
-rw-r--r--examples/quickcontrols/gallery/pages/StackViewPage.qml17
1 files changed, 13 insertions, 4 deletions
diff --git a/examples/quickcontrols/gallery/pages/StackViewPage.qml b/examples/quickcontrols/gallery/pages/StackViewPage.qml
index 4472150e56..3df1dd114e 100644
--- a/examples/quickcontrols/gallery/pages/StackViewPage.qml
+++ b/examples/quickcontrols/gallery/pages/StackViewPage.qml
@@ -1,6 +1,8 @@
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+pragma ComponentBehavior: Bound
+
import QtQuick
import QtQuick.Controls
@@ -23,26 +25,33 @@ StackView {
width: parent.width
wrapMode: Label.Wrap
horizontalAlignment: Qt.AlignHCenter
- text: "StackView provides a stack-based navigation model which can be used with a set of interlinked pages. "
+ text: qsTr("StackView provides a stack-based navigation model which can be used with a set of interlinked pages. "
+ "Items are pushed onto the stack as the user navigates deeper into the material, and popped off again "
- + "when he chooses to go back."
+ + "when he chooses to go back.")
}
Button {
id: button
- text: "Push"
+ text: qsTr("Push")
anchors.horizontalCenter: parent.horizontalCenter
width: Math.max(button.implicitWidth, Math.min(button.implicitWidth * 2, pane.availableWidth / 3))
onClicked: stackView.push(page)
}
Button {
- text: "Pop"
+ text: qsTr("Pop")
enabled: stackView.depth > 1
width: Math.max(button.implicitWidth, Math.min(button.implicitWidth * 2, pane.availableWidth / 3))
anchors.horizontalCenter: parent.horizontalCenter
onClicked: stackView.pop()
}
+
+ Label {
+ width: parent.width
+ wrapMode: Label.Wrap
+ horizontalAlignment: Qt.AlignHCenter
+ text: qsTr("Stack Depth:") + " " + stackView.depth
+ }
}
}
}