×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    93

    PageStack transition animation

    Hi!

    I'am using PageStackWindow MeeGo QtQuick Component in my app. When I replace current page in the stack I delete this page from the memory. When I create a new page I want that the stack perform pop transition animation with this new page. PageStack provide pop transition animation with a page which was pushed into the PageStack in the past, but I delete like this pages from the memory. How I can resolve this problem?

  2. #2
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: PageStack transition animation

    Show us your code,

    Read this QML pagestack element : QML PageStack Element Meego
    I hope you will find something helpful.

    regards,
    rahul

  3. #3
    Registered User
    Join Date
    Oct 2011
    Posts
    93

    Re: PageStack transition animation

    Quote Originally Posted by rahulvala View Post
    Show us your code,

    Read this QML pagestack element : QML PageStack Element Meego

    regards,
    rahul
    So.

    I create new Page "A" in Qt C++ code and push it in PageStack. Then I create new Page "B" and replace Page "A" to Page "B" in the PageStack and when page "A" has been deactivated I delete page "A" from the memory. But I want to perform push and pop transition animations with new pages that I create dynamically from Qt C++ code.
    Last edited by HellStranger; 2011-12-01 at 05:22.

  4. #4
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: PageStack transition animation

    Page stack Push and Pop transition : http://harmattan-dev.nokia.com/docs/...tml#pop-method

  5. #5
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: PageStack transition animation

    Hi,
    You should not delete the page, but you should delete the content of the pages. This is well explained in the link posted by rahulvala. Check the "Advanced Usage" section, there is an example there.
    Basically the idea is to create 2 or more empty pages at beginning. Those have dynamic content which is created when the page is visible and destroyed when the page is hidden.
    Why are you creating these pages by using C++?

  6. #6
    Registered User
    Join Date
    Oct 2011
    Posts
    93

    Re: PageStack transition animation

    Quote Originally Posted by gnuton View Post
    Hi,
    You should not delete the page, but you should delete the content of the pages. This is well explained in the link posted by rahulvala. Check the "Advanced Usage" section, there is an example there.
    Basically the idea is to create 2 or more empty pages at beginning. Those have dynamic content which is created when the page is visible and destroyed when the page is hidden.
    Pages amount is variable. It may be over hundred. Therefore 2 or 3 or 10 empty pages may be not enough.
    What amount of the RAM use PageStack with many tens or over hundred empty pages? I suppose it is not negligibly.
    Example in "Advanced Usage" section of documentation for little constant pages amount.

    Why are you creating these pages by using C++?
    This is very conveniently for my app architecture. I control the memory usage at any moment.
    Last edited by HellStranger; 2011-12-01 at 11:21.

  7. #7
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: PageStack transition animation

    Hi,
    The memory used by empty pages should be shared among these. So it should not be a big problem from a memory usage point of view.
    BTW in your case it doesn't look so elegant as option, you are right! ;D

    Here what I suggest you to use, I hope it's a suitable option for you:

    1. Create the first page with a content which is created/destroyed when the page is visible.
    2. when user needs a new page you can create it with the following
    pageStack.push(Qt.resolvedUrl("foo.qml"), { foo: bar, foz: baz });
    3. when the "back/left arrow" button is pressed, the current page is removed from the stack (pop()) you can remove it
    property Item mObject;
    mObject = pageStack.pop(pageStack.depth - 1, false);
    mObject.destroy();
    or simply
    pageStack.pop(pageStack.depth -1 , false).destroy();


    Keep in mind that replacing pages is evil.

  8. #8
    Registered User
    Join Date
    Oct 2011
    Posts
    93

    Re: PageStack transition animation

    Quote Originally Posted by gnuton View Post

    1. Create the first page with a content which is created/destroyed when the page is visible.
    2. when user needs a new page you can create it with the following
    pageStack.push(Qt.resolvedUrl("foo.qml"), { foo: bar, foz: baz });
    3. when the "back/left arrow" button is pressed, the current page is removed from the stack (pop()) you can remove it
    property Item mObject;
    mObject = pageStack.pop(pageStack.depth - 1, false);
    mObject.destroy();
    or simply
    pageStack.pop(pageStack.depth -1 , false).destroy();


    Keep in mind that replacing pages is evil.
    Hi! Thank's for exactly response. I have guessed an analogous solution. But if user want to go to deep up to hundredth page I should create hundred empty pages. This is not the best solution from a memory usage point of view.

    Quote Originally Posted by gnuton View Post
    The memory used by empty pages should be shared among these.
    What you mean? Can you explain more exactly please?

  9. #9
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: PageStack transition animation

    Quote Originally Posted by HellStranger View Post
    What you mean? Can you explain more exactly please?
    Take a look at http://doc.qt.nokia.com/latest/implicit-sharing.html

Similar Threads

  1. Replies: 2
    Last Post: 2011-11-18, 05:58
  2. How to change toolbar buttons in every pageStack page
    By shintu in forum [Archived] Qt Quick
    Replies: 5
    Last Post: 2011-11-06, 16:11
  3. Problem with PageStack - too much memory usage
    By rogeriopaladino in forum [Archived] Qt Quick
    Replies: 4
    Last Post: 2011-10-25, 22:29
  4. How to use Fly Transition and Scale Transition ?
    By gougou0601 in forum Symbian User Interface
    Replies: 1
    Last Post: 2011-03-24, 07:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×