how to make button push to another qml file
-
im new in qt creator , how i can make a button event on click , push or navigate to other qml file without stackview , only button navigate to another qml file
-
Hi @trustman and Welcome
If you do not want a container likeStackView
then you can do it simply by using a Loader. It has source property which you can use to load a particular QML file. Changing the url will unload the previous component and load the new one. Check out the example there.
Now to make this work withButton
you just have to set theLoader
'ssource
onButton
's click event. Eg.Button { text: "MyButton" onClicked: loader.source = "MyFile.qml" //loader = id of Loader }
-
-
Thank you every body
-
This post is deleted! -
But this method load the page on previous page , i want method to navigate to second page
-
@trustman
then you have use Loader since you don't want to use StackView.
Or implement you own stack. -
This post is deleted!