[SailfishDevel] PageStack: from push pushAttached directly to initialPage

Michael Fuchs michfu at gmx.at
Thu Sep 8 15:52:09 UTC 2016


The find function looks promising.

But where do I set the id of the mainPage, which is accessible via 
pageStack?

ApplicationWindow
{
     id: app
     initialPage: Component { id: here?; TaskList { id:here?; } }

}


Am 08.09.2016 um 17:16 schrieb Andrey Kozhevnikov:
> pageStack.pop(id of mainPage or page found using pageStack.find function)
>
> ------ Исходное сообщение ------
> От: "Michael Fuchs" <michfu at gmx.at>
> Кому: devel at lists.sailfishos.org
> Отправлено: 08.09.2016 19:39:39
> Тема: Re: [SailfishDevel] PageStack: from push pushAttached directly to
> initialPage
>
>> Thanks for your attention. ;)
>>
>> I guess I got it:
>>
>> onClicked: pageStack.replaceAbove(null, app.initialPage);
>>
>> ...works for me.
>>
>>
>>
>>
>> Am 08.09.2016 um 13:18 schrieb Michael Fuchs:
>>> 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"), {});
>>>     }
>>>   }
>>> }
>>> ==================
>>>
>>>
>>> _______________________________________________
>>> SailfishOS.org Devel mailing list
>>> To unsubscribe, please send a mail to
>>> devel-unsubscribe at lists.sailfishos.org
>> _______________________________________________
>> SailfishOS.org Devel mailing list
>> To unsubscribe, please send a mail to
>> devel-unsubscribe at lists.sailfishos.org
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org


More information about the Devel mailing list