[PyQt] QTableView performance issue

Massi massi_srb at msn.com
Fri Nov 2 10:44:52 GMT 2012


Hi everyone,

I've got a QTreeView with a custom model which has to handle several items (say 1 million). I've set the setUniformRowHeights property to True, so when the tree is set up the scrolling is very fluid. The problem arises when I try to change the ordering of the items. 
The test script attacched illustrates the situation I have to deal with: I use the row_id list to map the items to be shown at a given index; I do this in order to use my own C-written sorting function to order the items. Now if you push the “Shuffle” button (which simulates the sorting) you can see that even if the execution time is fast (0.6 sec on my pc), the tree requires several seconds to be updated.
Can anyone point me out what I am doing wrong? 

Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20121102/16934e01/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.py
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20121102/16934e01/attachment-0001.ksh>


More information about the PyQt mailing list