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.

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