Go faster with Loader objects



  • First, why something like that :

    Loader {
        active:false;
        source : "Object.qml";
    }
    

    is faster than

    Loader {
        active:false;
        sourceComponent: Component {Object{}}
    }
    

    Actually, I guess I understand that in the fist case, while active is not set to true, we do not load anything, and in the second case you must create the Component even if the active variable is set to false.
    Am I right?

    Second question, in the documentation of Loader, they talk about delegates and it is said :
    In some cases you may wish to use a Loader within a view delegate to improve delegate loading performance.

    I do not really understand why Loader makes performances better inside a delegate because to me, the "workflow" is the same with or without the Loader...

    Is it because delegates do not need to be "recomputed" since they are loader by Loader ?

    Thanks :)



  • Multiple loaders can run in parallel (with asynchronous: true). In a ListView, many delegates might have to be created at the same time. So using loaders for delegates can utilize more CPU time and thus load the view's content faster.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.