Pregunta

am having a signin page which has a Navigation pane,while the user logins successfully i should redirect to the main.qml file ,while clicking ii can't able to go from the signin.qml file to main.qml file ? how to do this can anyone give me sugession`

¿Fue útil?

Solución

You can find all about NavigationPane and other controls in documentation only.

NavigationPane documentation

It's very simple. You should go through it once properly and give it a shot by yourself.

Have a look at below shown segment of code, you should get the idea.

NavigationPane {
    id: navigationPane
    Page {
        attachedObjects: ComponentDefinition {
            id: pageDefinition
            source: "main.qml"
        }
        Container {
            Button {
                text: "Login"
                onClicked: {
                    //check if credentials are valid or not
                    if(isValidUser())
                    {
                        var page = pageDefinition.createObject();
                        navigationPane.push(page);
                    }
                    else
                    {
                        //show error message
                    }
                }
            }
        }
    }
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top