StackView QMLタイプの中に3つのコンポーネントがあり、push()
とpop()
を使用してビューを変更できます。さらに、私はそのUIにpush()またはpop()を実行すると、ユーザー構成に基づいてUI(Component)を更新したいと思います。ドキュメントを見て、私はこの場合にはStack.status
が面白いと感じましたが、それをどのように使用するかはわかりません。QML StackViewのステータスプロパティの使い方は?
誰かがそれに関するいくつかの例を挙げることができますか?以下は
私はスタックビューに私の画面をロードし、ナビゲートする方法のコードです:
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
{
}
}