[Qt-interest] Why QListView is so slow and QTableView is fast?

william.crocker at analog.com william.crocker at analog.com
Wed Aug 26 14:57:59 CEST 2009



Arnold Krille wrote:
> On Wednesday 26 August 2009 14:26:08 Kenneth Beck wrote:
>> I am having a very similar problem with a QTableView. Once the model is
>> filled and the user is just moving around the table, just moving from
>> one cell to the other, or moving the scroll bar, takes a lot of time.
>> Each call to the data() method requires a search into the model to find
>> the data, but the model only contains a few 10's of items, it is not
>> large. Does anyone know where to look for ways to speed this up? Are
>> there some optimization tricks?
> 
> If there are only few entries in the model, test your app with "valgrind --
> tool=callgrind" to see where the time is spent.
> 

And make sure you are running your app with a 'release/optimized'
version of the Qt libraries. Your code should be optimized as well.

Bill



More information about the Qt-interest-old mailing list