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

Bug #1361919 reported by Antti Kaijanmäki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu UI Toolkit
Fix Released
Critical
Tim Peeters
ubuntu-ui-toolkit (Ubuntu)
Fix Released
Undecided
Unassigned
Vivid
Fix Released
Undecided
Unassigned
ubuntu-ui-toolkit (Ubuntu RTM)
New
Undecided
Unassigned

Bug Description

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

Related branches

Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

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

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

Bar.qml:
            pageStack.push(Qt.resolvedUrl("FooPage.qml"),
                           {
                               activateCb: myActivateFunction
                           });
....

Zsombor Egri (zsombi)
Changed in ubuntu-ui-toolkit:
importance: Undecided → Critical
assignee: nobody → Tim Peeters (tpeeters)
status: New → Confirmed
Tim Peeters (tpeeters)
Changed in ubuntu-ui-toolkit:
status: Confirmed → In Progress
Revision history for this message
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?

Revision history for this message
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 (Page.active is not true) yet, and it is not yet on top of the stack. This is only guaranteed after the header animations finish.

Revision history for this message
Tim Peeters (tpeeters) wrote :

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

Revision history for this message
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)
Changed in ubuntu-ui-toolkit:
milestone: none → 10.24
Tim Peeters (tpeeters)
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.