PDA

View Full Version : True virtual model-view ?



TorAn
2nd December 2009, 14:42
I was waiting for 4.6 to offer something new in the area of model-view architecture and did not find any changes, at least in the documentation. Hope that I missed smth!

I have a view of over 10^6 entries in the file that I am showing in a treeview (3 columns).

I had to implement my own paging because Qt model shows all top-level items on the start, which makes showing that # of items using default Qt mechanics impossible.

Can anybody suggest a better Qt-based way of showing that many entries? Oh, how I miss virtual lists in C#...

squidge
2nd December 2009, 14:47
I'm using a QTreeView in a project at the moment that can contain upwards of 1 million items, and Qt only requests the items that are visible, not all of them, so the view is instant.

Maybe you can post some code?

jpujolf
3rd December 2009, 12:12
I had to implement my own paging because Qt model shows all top-level items on the start, which makes showing that # of items using default Qt mechanics impossible.

Can anybody suggest a better Qt-based way of showing that many entries? Oh, how I miss virtual lists in C#...

You have to call
setUniformRowHeights ( true )

This avoids calling ALL row heights on startup and as fatjuicymole said, will only call for visible data. The speedup is noticeable...