Forums

OverviewFelgo 2 Support (Qt 5) › How to run function when the page was becomes the active page?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #20367

    Kacper

    I want to run function “factorial” when page has been becomes the active page. How I can do It?

    NavigationStack{
                    Page{
    
    
                        id: taskrow
                        title: "Listy"
                        SearchBar {
                             id: searchBarThreads
                             onAccepted: {
    
                             }
                          }
    
                        AppListView {
                                delegate: SimpleRow {
                                  onSelected: console.log("Clicked Item #"+index)
                                  width: parent.width/2
                                }
                                model: [
                                  {
                                    text: "Lista 1",
                                    detailText: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
                                  },
    
                                  {
                                    text: "Lista 2",
                                    detailText: "Sed vel ipsum ac dui aliquam ornare.",
                                  },
    
                                  {
                                    text: "Lista 3",
                                    detailText: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
                                  },
    
                                  {
                                    text: "Lista 4",
                                    detailText: "Sed vel ipsum ac dui aliquam ornare.",
                                  }
                                ]
                              }
                        function factorial() {
                                if(isCurrentStackPage==true);
                                else{
                                    taskrow.title = "false";
                                }
                            }
                    }
                }

     

    #20373

    Günther
    Felgo Team

    Hi,

    the page offers signals like Page::appeared or Page::pushed to add handler code at certain points of the Page lifecycle on the NavigationStack.

    Best,
    Günther

Viewing 2 posts - 1 through 2 (of 2 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