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. Go faster with Loader objects

Go faster with Loader objects

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 578 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.
  • Q Offline
    Q Offline
    qnope
    wrote on last edited by qnope
    #1

    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 :)

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by A Former User
      #2

      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.

      1 Reply Last reply
      2

      • Login

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