当需要某些页面加载一次时,如何一起使用加载程序和堆叠式视图?

发布于 2025-02-09 13:10:14 字数 1129 浏览 0 评论 0原文

我有这样的页面流:

​页面将加载“ 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:

enter image description here

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文