[Interest] how do I load massive table views instantly?

Constantin Makshin cmakshin at gmail.com
Fri Jun 5 01:33:01 CEST 2020


Here is my idea:
1) quickly calculate/get the total number of items and return that value from rowCount() to let views properly configure their scroll bars;
2) load data in the background;
3) return some placeholder values from data() for items that have not been loaded yet;
4) when a new batch of items is available, add it to the model's internal storage and emit the dataChanged() signal with appropriate index range.

On 06/05/2020 12:39 AM, David M. Cotter wrote:
>> What did you try so far?
> the other thing tried was showing the table without pre-loading it, but then loading the rest in the background
> 
> but this has the problem that the user can't then pick up the scroll thumb and drag it to the bottom, because not all the data is loaded.  as soon as the user lets go, more data keeps getting loaded and the scroll thumb slides out from under their mouse as more data comes in.
> 
> uck
> 
> :)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200605/116d3a3e/attachment.sig>


More information about the Interest mailing list