Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 2 Support (Qt 5) › Move to pages by button clicks

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

    Wojciech

    I have a main item with Navigation object, that has four pages. Changing pages by navigation menu works OK.

    On the first page, which is my “application cockpit”, I have some additional buttons for navigating: I want to use these buttons to move to most important pages from navigation menu. How I could do that? Is navigation object visibile globally?

    #18523

    Alex
    Felgo Team

    Hi

    I hope I understand the question correctly, are you looking for something like this:

    import Felgo 3.0
    import QtQuick 2.5
    
    App {
    id: app
    
      Navigation {
        id: navigation
        NavigationItem {
          title: "First"
          icon: IconType.heart
          NavigationStack {
            Page {
              title: "First Page"
              
              AppButton {
                anchors.centerIn: parent
                text: "Open Second Page"
                onClicked: {
                  navigation.currentIndex = 1
                }
              }
            }
          }
        }
        
        NavigationItem {
          title: "Second"
          icon: IconType.heart
          NavigationStack {
            Page {
              title: "Second Page"
              AppButton {
                anchors.centerIn: parent
                text: "Open First Page"
                onClicked: {
                  navigation.currentIndex = 0
                }
              }
            }
          }
        }
      }
    }

    I am changing the active navigation item by changing the currentIndex of the navigation with my buttons.

    Cheers,
    Alex

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

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded