Forums

OverviewFelgo 2 Support (Qt 5) › Help with onPushed()/onPopped()

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #17964

    Lorne

    I’m having some trouble using onPushed() and onPopped() in a NavigationStack.  Here’s a sample of the code:

          NavigationStack {
            JobsPage { }
    
            onPushed: {
              console.log("push " + item);
              console.log("push.id " + item.id);
              console.log("push.name " + item.objectName);
            }
    
            onPopped: {
              console.log("pop " + item);
              console.log("pop.id " + item.id);
              console.log("pop.name " + item.objectName);
            }
          }

    The output looks like the following:

     

    qml: push NavigationStack_QMLTYPE_62(0x60f0000b74c0, “_NavigationStack”)

    qml: push.id undefined

    qml: push.name _NavigationStack

    qml: pop NavigationStack_QMLTYPE_62(0x60f0000b74c0, “_NavigationStack”)

    qml: pop.id undefined

    qml: pop.name _NavigationStack

     

    How exactly am I suppose to recognize which page is pushed and popped?  I can’t seem to identify the pages by id or objectName.

     

    #17965

    Günther
    Felgo Team

    Hi Lorne,

    The NavigationStack::popped and pushed signals pass a page parameter, which holds the Page item that is popped or pushed to the stack.

    Best,
    Günther

    #17967

    Lorne

    Yes I see the error now.  I was trying to access the variable name as item, instead of page.  It’s working now, thank you.

Viewing 3 posts - 1 through 3 (of 3 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support