当需要某些页面加载一次时,如何一起使用加载程序和堆叠式视图?
我有这样的页面流:
页面将加载“ stackView”,“ stackView”“ loader”中没有nast(load),只是我不可见的是,它是“ load for load” dashboard“类似:
Loader {
id:loader
anchors.fill: parent
visible: true // till authorization
source: "qrc:/pages/Splash.qml"
}
StackView {
id: stack_view
anchors.fill: parent
visible: false // till authorization done and load dashboard
}
StateGroup {
id: state_group
state: "SPLASH"
states: [
State {
name: "SPLASH"
PropertyChanges {target: loader; source: "qrc:/pages/Splash.qml"}
},
State {
name: "AOUTHORIZE"
PropertyChanges {target: loader; source: "qrc:/pages/Login.qml"}
},
State {
name: "STACKVIEW"
PropertyChanges {target: loader; visible: false}
PropertyChanges {target: stack_view; visible: true}
}
]
}
如图所示“ splash”和“授权“ load”一次,“仪表板”,“仪表板”和其他页面可能会加载几次,我想知道我使用“ Loader”和“ StackView”的方式吗?还是Beter使用的方式和哪些组件?
I have a pages flow like this:
That i Implemented it with a "Loader" and a "StackView", "splash" and "authorize" load in "Loader", and "Dashboard" and other pages will load in "StackView", "StackView" is not nasted (load) in "Loader", Just i invisable it befor load "Dashboard" like:
Loader {
id:loader
anchors.fill: parent
visible: true // till authorization
source: "qrc:/pages/Splash.qml"
}
StackView {
id: stack_view
anchors.fill: parent
visible: false // till authorization done and load dashboard
}
StateGroup {
id: state_group
state: "SPLASH"
states: [
State {
name: "SPLASH"
PropertyChanges {target: loader; source: "qrc:/pages/Splash.qml"}
},
State {
name: "AOUTHORIZE"
PropertyChanges {target: loader; source: "qrc:/pages/Login.qml"}
},
State {
name: "STACKVIEW"
PropertyChanges {target: loader; visible: false}
PropertyChanges {target: stack_view; visible: true}
}
]
}
As diagram shows "Splash" and "Authorize" load once, "Dashboard" and other pages may load several times, I want to know the way i used "Loader" and "StackView" is good? or how and what components is beter to use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论