how to make button push to another qml file
-
wrote on 7 Oct 2015, 12:45 last edited by
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
-
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 }
-
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
wrote on 8 Oct 2015, 07:50 last edited by -
wrote on 9 Oct 2015, 06:09 last edited by
Thank you every body
-
wrote on 12 Oct 2015, 09:20 last edited byThis post is deleted!
-
wrote on 12 Oct 2015, 09:35 last edited by
But this method load the page on previous page , i want method to navigate to second page
-
But this method load the page on previous page , i want method to navigate to second page
-
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 }
wrote on 18 Jun 2020, 02:29 last edited by trupti007This post is deleted!