StackView properties
Solved
QML and Qt Quick
-
Hello,
I am a beginner with QT. I try to use Stackview component in QML.
But I have a problem.
I have two qml files, my first qml file contain a stackview.I push a new qml file with:
stackview.push(Qt.resolvedUrl(Qt.resolvedUrl("second.qml"))
its woking fineBut now I want send properties to my second qml file.
stackView.push({item : Qt.resolvedUrl("second.qml"), properties : { locale : qsTr("test param") }})its working but I dont know how to get "locale" parameter value in second.qml :(
Any idea ?
-
I have find a solution,
1.add this line in first qml file and in second qml file :
property string locale
- and to push second qml file use :
stackView.push({item : Qt.resolvedUrl("second.qml"), properties : { "locale" : "test param" }})
- in the second qml file the value can be read in locale property.