[Qt-interest] QAbstractListModel Scrolling Performance Issue
Scott Aron Bloom
Scott.Bloom at sabgroup.com
Wed Dec 3 19:25:19 CET 2008
> >Back to the list :)
>
> Hit the wrong reply button. :)
Figured... no worries...
>
> >
> >Have you tried the setUniformRowHeights trick?
>
> No difference.
Hmm this "usually" fixes the problem you see next
>
> >
> >Again, just trying to focus in on the problem, have you tried using a
> >QTableView ?
>
> QTableView doesn't have the performance problems, perfectly smooth
there.
> However, visually it doesn't look nearly as good. The representation
of the
> data in the QTreeView looks by far better than the excel-like
spreadsheet look
> QTableView gives.
Not surprising... I have seen this more then once where table view, by
not looking as pretty, is MUCH much faster..
>
> I've traced the problem in the QTreeView down to an excessive number
of
> ::data() calls. With my resultset and 6 columns I end up with over
1,550,000
> ::data calls when scrolling from top to bottom compared to around
33,000 done
> by the QTableView with the same dataset.
Which data calls are you seeing? Rather than just making a count, try a
map of int to int, where the first in is the Role being queried...
You might want to create a custom delegate to block some of the calls.
I have done this before as well, where a custom delegate that just made
assumptions, like no decoration roles etc etc sped things up
tremendously.
Scott
More information about the Qt-interest-old
mailing list