Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Loading a large list model with a WorkerScript

$
0
0
I am trying to use a WorkerScript to load up a list model with a very large data set. Something like: WorkerScript.onMessage = function(msg) {     if (msg.action == 'append')     {         var model = msg.model;         for (var i = 0 ; i < msg.data.length ; i++)         {             var o = {...};             model.append(o)             model.sync();         }     } } As far as I can tell I need to sync() after every append() or else the ListView doesn’t display correct. I will see some of the rows repeated at the end although the count is right and the extra items can’t be selected. But the sync() call makes longing considerable slower — from seconds to minutes. Is there a better way of doing this?

Viewing all articles
Browse latest Browse all 4972

Trending Articles