[SailfishDevel] PageStack: from push pushAttached directly to initialPage
Michael Fuchs
michfu at gmx.at
Thu Sep 8 11:18:26 UTC 2016
Hi guys,
I got a question about the PageStack.
I got a main page and a filter page, which can be push() 'ed or
pushAttached() several times. Either via PullDownMenu or swipe to left.
I would like to have another item in the pulldownmenu, which lets me
directly go back to the first page ("Back To FirstPage"), no matter how
the pages where added to the stack.
Thanks a lot,
Michael.
FirstPage.qml
==================
Page {
...
PullDownMenu {
MenuItem {
text: qsTr("Filters")
onClicked: pageStack.navigateForward();
}
}
...
onStatusChanged: {
if (status === PageStatus.Active && pageStack.depth === 1) {
pageStack.pushAttached(Qt.resolvedUrl("Filters.qml"), {});
}
}
}
==================
Filters.qml
==================
Page {
...
PullDownMenu {
MenuItem {
text: qsTr("Specific Filters")
onClicked: pageStack.push(Qt.resolvedUrl("Filters.qml"));
}
MenuItem {
text: qsTr("More Filters")
onClicked: pageStack.navigateForward();
}
MenuItem {
text: qsTr("Back To FirstPage")
onClicked: /*what to put here????*/;
}
}
...
onStatusChanged: {
if (status === PageStatus.Active && pageStack.depth === 1) {
pageStack.pushAttached(Qt.resolvedUrl("Filters.qml"), {});
}
}
}
==================
More information about the Devel
mailing list