I have some 3 Components inside the StackView QML type and I am able to change the views using push()
and pop()
. Further down, I would like to update UI(Component) based on user configurations when I push() or pop() to that UI. Going through the documentation, I found Stack.status
interesting in this case, but have no idea how to use it.
Can anyone give some example regarding it?
Below is the code how I load my screens into the stack view and navigate:
StackView {
id: stackView
visible: false
// rotation: 180
anchors.fill: parent
initialItem: componentHome
Component.onCompleted:
{
}
}
Component
{
id: componentHome
Home
{
//This is how I traverse the screens
onMenuClicked:
{
console.log("opening "+name+" screen")
if(name === "settings")
{
//Here, for eg. how to update UI in Settings screen before pushing it?
stackView.push(componentSettings)
}
}
}
}
Component
{
id: componentSettings
Settings
{
}
}
Component
{
id: componentPlay
Play
{
}
}