PDA

View Full Version : [SOLVED] Incomplete QTreeView



Guilo
29th December 2009, 22:15
Hi !

I am trying to visualize a databse thanks to a QTreeView. I am using a QSqlQueryModel to extract my data and present it to the widget. But my query returns about 8000 values. So when the qtreeview appears, not all the results are available yet. If i pick the slider on the right and get it to the bottom, once I release it, it gets a little jump and I have to go down more if I want to see the rest of the list.

This problem is annoying because I want to filter my tree with QSortFilterModel. And if I type data that is at bottom of the list the filter won't show anything while i haven't gone to see the bottom of the list with the slider.


So, is it possible to set the size of what QTreeView displays at firt launch or something like this ?

Thanks

Lykurg
29th December 2009, 22:19
Try
while(model->canFetchMore())
model->fetchMore();

Guilo
29th December 2009, 22:31
Thank you that solved the problem.

Guilo
30th December 2009, 12:47
I have a last question : Now all work great, filtering is a bit slow : when i type the first letter, it will took about 1 second during which I can't do anything before filtering. I know that I have a big model but I have compiled the exact same code on the same machine for linux. And it is much faster. Why such a difference ? Is it fixable under Windows ?

Thanks