Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Loader shows nothing when loading a large number of elements asynchronously

Loader shows nothing when loading a large number of elements asynchronously

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 96 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Name already in useN Offline
    Name already in useN Offline
    Name already in use
    wrote on last edited by Name already in use
    #1

    Hello,

    I've played around with the Loader and stumbled upon a somewhat irritating behavior.

    When running this code

    import QtQuick 2.15
    import QtQuick.Window 2.15
    
    Window {
        width: 1500
        height: 1000
        visible: true
        title: qsTr("Hello World")
    
        Loader {
            sourceComponent: comp
            asynchronous: true
            anchors.fill: parent
            active: true
            visible: true
    
            onStatusChanged: {
                switch (status) {
                case (Loader.Ready): console.info("ready"); break;
                case (Loader.Loading): console.info("loading"); break;
                case (Loader.Error): console.error("error"); break;
                case (Loader.Null): console.info("null");
                }
            }
    
        }
    
        Component {
            id: comp
            Flow {
                anchors.fill: parent
                spacing: 2
                visible: true
                Repeater {
                    visible: true
                    model: 500
                    Rectangle {
                        visible: true
                        width: 5
                        height: 5
                        color: "blue"
                    }
                }
            }
        }
    }
    

    with the model property of the repeater set to > 500, nothing is shown in the window although the status is Loader.Ready. If the Loader is used synchronously, everything works as expected.

    Can anyone tell what is causing this problem?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved