[SailfishDevel] pageStack.pop() - send paramater to prev page

Christopher Lamb christopher.lamb at thurweb.ch
Thu Jun 5 12:02:24 UTC 2014


Sali Markus

I would also love to see a pop() method with parameters so I can pass info back to the previous page, jus like the push()

As a workaround I just set the page's properties directly immediately before the pop() call e.g:

     
    AreaSelectionPage  {

         id:  areaSelectionPage

             ....

         onBackPageWithInfo:  {

             mainPage.areaSet  =  true;

             mainPage.area_id  =  area_id;

             pageStack.pop(mainPage);

         }

         onCancelled:  pageStack.pop(mainPage);

      }


mfg

Chris




On 05.06.14 13:48, info at flyingfischer.ch wrote:
> Beginners follow up question
>
> Hello
>
> while transfering parameters works fine with
>
> pageStack.push(Qt.resolvedUrl("nextPage.qml", {topic: "myTopic"}))
>
> there seems not to be any method like this in
>
> pageStack.pop()
>
> How can I give back a parameter from the top of the stack to the 
> previous page?
>
> Thanks for you inputs and patience!
>
> Markus Fischer
>
> ------------------------------------------
>
> I tried:
>
> Page {
>     id: onTopOfStack
>     property string topic
> ...
>         Column {
>             id: column
> ...
>             Button {
>                 id: myTopic
>                 text: qsTr("MyTopic")
>                 anchors.horizontalCenter: parent.horizontalCenter
>                 onClicked: {
>                     topic: "MyTopic"
>                     pageStack.pop();
>                 }
>             }
> ------------------------------------------
>
> Page {
>     id: previousPage
>     property string topic
> ...
>     SilicaFlickable {
>         id: mainFlickable
> ...
>         Column {
>             id: mainColumn
> ...
>             PageHeader {
>                 id: header
>                 title: qsTr(topic)
>             }
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to 
> devel-unsubscribe at lists.sailfishos.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20140605/4b5d3e6d/attachment.html>


More information about the Devel mailing list