Skip to content

Commit a57fbb0

Browse files
committed
qml: demo StorageOptions component
To achieve a proper demo, the component is added to our StackLayout. Now that there are several components, introduce a toolbar with a textButton "< Back" that allows for rewinding the stack.
1 parent 5b7b74d commit a57fbb0

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/qml/pages/stub.qml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ ApplicationWindow {
1818

1919
Component.onCompleted: nodeModel.startNodeInitializionThread();
2020

21+
menuBar: RowLayout {
22+
height: 50
23+
Layout.leftMargin: 10
24+
Loader {
25+
active: stack.currentIndex > 0 ? true : false
26+
visible: active
27+
sourceComponent: TextButton {
28+
text: "‹ Back"
29+
onClicked: stack.currentIndex -= 1
30+
}
31+
}
32+
}
2133
ColumnLayout {
2234
anchors.centerIn: parent
2335
spacing: 15
@@ -54,11 +66,12 @@ ApplicationWindow {
5466
Layout.fillWidth: true
5567
ConnectionOptions {}
5668
ConnectionSettings {}
69+
StorageOptions {}
5770
}
5871
ContinueButton {
5972
Layout.alignment: Qt.AlignCenter
60-
text: stack.currentIndex < 1 ? qsTr("Continue") : qsTr("Back")
61-
onClicked: stack.currentIndex < 1 ? stack.currentIndex = 1 : stack.currentIndex = 0
73+
text: stack.currentIndex > 0 ? qsTr("Next") : qsTr("Start")
74+
onClicked: stack.currentIndex < 2 ? stack.currentIndex += 1 : null
6275
}
6376
PageIndicator {
6477
Layout.alignment: Qt.AlignCenter

0 commit comments

Comments
 (0)