Tour Preview

Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

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.