The PageStack itself does not report the completion of transitions, but the 
Page objects involved in the transition see the transition events as changes to 
their 'status' property:
https://sailfishos.org/develop/docs/silica/qml-sailfishsilica-sailfish-silica-page.html/#status-prop

When a transition begins, the incoming page status changes to 
PageStatus.Activating, and the outgoing page status changes to 
PageStatus.Deactivating.  After the transition completes, their respective 
statuses become PageStatus.Active and PageStatus.Inactive.

You can perform actions in response to changes of the Page.status property, 
knowing that the PageStack transition is no longer active.

Thanks,
Matt

________________________________
From: devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] 
on behalf of occirol [develo...@nordan.ch]
Sent: Thursday, July 21, 2016 5:15 AM
To: Sailfish OS Developers
Subject: Re: [SailfishDevel] pageStack navigation

@Dylan
According to the doc, there is no function completeTransition for a PageStack 
object.

@Oleg
I've something weird with your solution. Goal is reach but the MainPage is 
empty, as if the app was never started. :/

If I found a solution I'll let you know. If someone as an idea, welcome ;)

@+, Fab


Le 20. 07. 16 à 18:37, Oleg Linkin a écrit :
Why not do the next:

pageStack.clear()
pageStack.push(MainPage)?

2016-07-20 19:36 GMT+03:00 Dylan Van Assche 
<dylan.van.ass...@protonmail.com<redir.aspx?REF=5UfGJdZjuqfB1yv-ScC_Jl8ln1hC0ANG73GhHb8J_doJuNKC5bDTCAFtYWlsdG86ZHlsYW4udmFuLmFzc2NoZUBwcm90b25tYWlsLmNvbQ..>>:
Hi,

You should add this:

if(!pageStack.busy)
{
pageStack.pop()
}

This will prevent the issue but it will give you another bug: only one page 
will be popped.

You can fix it like this:


if(!pageStack.busy)
{
pageStack.pop()
pageStack.completeTransition() // This will pop the page directly.
}

-------- Original Message --------
Subject: [SailfishDevel] pageStack navigation
Local Time: July 20, 2016 6:02 PM
UTC Time: July 20, 2016 4:02 PM
From: 
develo...@nordan.ch<redir.aspx?REF=pWRC7fgoRnOnLMp5PpvXAXQhNjiRykk-V_o1O0-w0NQJuNKC5bDTCAFtYWlsdG86ZGV2ZWxvcGVyQG5vcmRhbi5jaA..>
To: 
devel@lists.sailfishos.org<redir.aspx?REF=eBLTWFeh7MMSxFSKmc9AeGHy9zj7NGQg6imd4kxByF4JuNKC5bDTCAFtYWlsdG86ZGV2ZWxAbGlzdHMuc2FpbGZpc2hvcy5vcmc.>



Hello everybody !

I can't figure out how to go back to the main page of an app and clear the 
stack of pages. Let me explain:

I've a main page, by selecting a menu entry push a page (lets call it page1). 
On this page1, calling a certain action, push another page (call it page2, it 
is a dialog page) on the stack.

So in the stack, I have the following pages:  [MainPage, Page1, Page2]

But now, from page2, I want to go back to MainPage. So I did this first in the 
page2 code :

   onAccepted: {
        pageStack.pop()
    }

But:


Warning: cannot pop while transition is in progress

Ok, so I tried this instead:

acceptDestination: Qt.resolvedUrl("MainPage.qml") acceptDestinationAction: 
PageStackAction.Pop

Still: Warning: cannot pop while transition is in progress

And doing this:

   onAccepted: {         pageStack.pop(null, false)     }

Is working in term of results, but before going to the main page I see the 
page2 for a little while.

So, I should miss something here for sure. Any ideas or recommendation ? Maybe 
am I bad designing the navigation in the app ?

Thanks a lot !

Regards,

Fab


_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to 
devel-unsubscr...@lists.sailfishos.org<redir.aspx?REF=NK_0t54EQ2um-GsqRVRTvrVjKvqQxYRZQuX1UA5Txy4JuNKC5bDTCAFtYWlsdG86ZGV2ZWwtdW5zdWJzY3JpYmVAbGlzdHMuc2FpbGZpc2hvcy5vcmc.>




_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to 
devel-unsubscr...@lists.sailfishos.org<redir.aspx?REF=NK_0t54EQ2um-GsqRVRTvrVjKvqQxYRZQuX1UA5Txy4JuNKC5bDTCAFtYWlsdG86ZGV2ZWwtdW5zdWJzY3JpYmVAbGlzdHMuc2FpbGZpc2hvcy5vcmc.>

_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to