PageStack::push() should return the object that was pushed

Bug #1361919 reported by Antti Kaijanmäki on 2014-08-27
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu UI Toolkit
Fix Released
Tim Peeters
ubuntu-ui-toolkit (Ubuntu)
ubuntu-ui-toolkit (Ubuntu RTM)

Bug Description

This way the caller can connect to any signals the pushed Component might have.

Related branches

Antti Kaijanmäki (kaijanmaki) wrote :

right now I'm working around this by havving a function object property in the page:

    /// work around LP(#1361919)
    property var activateCb;
            onClicked: activateCb("Foo")

                               activateCb: myActivateFunction

Zsombor Egri (zsombi) on 2014-10-01
Changed in ubuntu-ui-toolkit:
importance: Undecided → Critical
assignee: nobody → Tim Peeters (tpeeters)
status: New → Confirmed
Tim Peeters (tpeeters) on 2014-10-02
Changed in ubuntu-ui-toolkit:
status: Confirmed → In Progress
Tim Peeters (tpeeters) wrote :

could you use PageStack.currentPage instead?

I can add a returned page to push(), but note that push returns immediately, and header animations (to be enabled soon) may still be running when push() returns, and the new page will not be active (and on top of the stack yet) while the header is still animating. Can this give problems in your application?

Tim Peeters (tpeeters) wrote :

So how it will work when header animations are enabled:

- Push(yourpage) is called // yourpage may be a Page, Component, or qml file
- Fade out of the old header started
- Push *RETURNS* immediately (before fade out animation is finished)
- Fade out of old header finishes
- New page object is created (if needed), and pushed on the stack
- Fade in of new header

I plan to make Push return the newly created page as follow:

- Push(yourpage) is called
- New page object created (if needed)
- Fade out animation started
- Push() *RETURNS* new page object
- Fade out animation finishes
- New page object pushed on stack
- Fade in animation of new header

So note that when Push() returns the value, the new page object exists, but it may not be active ( is not true) yet, and it is not yet on top of the stack. This is only guaranteed after the header animations finish.

Tim Peeters (tpeeters) wrote :

Why is this bug critical? Which critical change do you need to make in which app?

PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:ubuntu-ui-toolkit/staging at revision None, scheduled for release in ubuntu-ui-toolkit, milestone Unknown

Changed in ubuntu-ui-toolkit:
status: In Progress → Fix Committed
Zoltan Balogh (bzoltan) on 2014-10-13
Changed in ubuntu-ui-toolkit:
milestone: none → 10.24
Tim Peeters (tpeeters) on 2014-10-24
Changed in ubuntu-ui-toolkit:
status: Fix Committed → Fix Released
Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Fix Released
Changed in ubuntu-ui-toolkit (Ubuntu Vivid):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers