[SailfishDevel] Cannot pop while operation is in progress : SOLVED
Wim de Vries
wsvries at xs4all.nl
Wed Aug 14 08:09:52 UTC 2013
Your suggestion indeed works like this:
I got the error because there was still a pop() somewhere in the current
Silly, I had been fiddling to much.
I now have a nice working app with mixed core QML and Sailfish UI and
controlled by c++!
> Correct me if I'm wrong, but I understand your page stack situation to be
> like this:
> [ ..., page0, page1, page2 ]
> and you want to pop page2, and also replace page1 with a new page, so you
> end up with:
> [ ..., page0, page3 ]
> Is that right? If so, then the first argument to replaceAbove() is the
> page above which all other pages should be popped - in the above example,
> page0 would be the argument. So passing pageStack.currentPage as the
> first argument to replaceAbove() is invalid, because there can't be any
> pages above the top.
> From: Wim de Vries [wsvries at xs4all.nl]
> Sent: Wednesday, August 14, 2013 5:42 PM
> To: Matthew Vogt
> Cc: Wim de Vries; devel at lists.sailfishos.org
> Subject: RE: [SailfishDevel] Cannot pop while operation is in progress
> Thanks Matt,
> This is my function in main.qml (called from within c++)
> function loadTextEdit(text)
> //pageStack.push(Qt.resolvedUrl("controls/MTextEdit.qml"))//works OK!
> return true;
> this results in this error:
> file:///usr/lib/qt5/qml/Sailfish/Silica/PageStack.js:111: Error: Cannot
> replace with target page at the top of the stack
>> "Cannot pop while operation is in progress" means that the previous
>> PageStack operation is still animating, and you must wait until it
>> finishes before issuing the next PageStack operation. There are various
>> strategies you can use for this, but they will all result in
>> visual changes: either double animations or disorientating jumps.
>> It sounds like you should probably use the 'replaceAbove' function:
>> This function is equivalent to "pop all pages above the supplied target
>> page, then push a new page", except that it occurs with a single visual
>> From: devel-bounces at lists.sailfishos.org
>> [devel-bounces at lists.sailfishos.org] on behalf of Wim de Vries
>> [wsvries at xs4all.nl]
>> Sent: Wednesday, August 14, 2013 6:02 AM
>> To: devel at lists.sailfishos.org
>> Subject: [SailfishDevel] Cannot pop while operation is in progress
>> If I do pop() within a current page
>> within main.qml I get:
>> "Cannot pop while operation is in progress"
>> I need to remove the previous page, so that the user cannot navigate
>> to this page.
More information about the Devel