[PyQt] Slow selection

Virgil Dupras hsoft at hardcoded.net
Mon Apr 21 22:30:46 BST 2014


On Mon, Apr 21, 2014, at 06:31 PM, Mads Ipsen wrote:
> Hi,
> 
> I have been having some performance issues with large tables and
> selection. I use table views to display coordinates of individual
> atoms in very large molecules (> 25000). Selection of atoms can be
> controlled by the user by
> 
> * Interacting with the table view through mouse selection, keyboard
>   selection.
> 
> * Interacting with an OpenGL window. In this case, the update of the
>   QItemSelectionModel is done programatically.
> 
> Even for very large systems, this performs very well.
> 
> However, if sorting and filtering is needed, a QSortFilterProxyModel
> must be employed.  Mouse and keyboard interaction with the table view
> is still snappy, whereas programmatic updates seems to slow things
> down to a halt.
> 
> I have attached a simple table example with 10000 rows. The employed
> proxy model is just the Qt base class with no added functionality. If
> you press 'Esc' (deselect) or 'Ctrl+A' (select all) everything is
> fast.
> 
> If you press the bottom 'Select top half', the top half table rows are
> selected using one single QItemSelection spanning the row range
> 0:n/2. In this case the GUI becomes almost unresponsive, and
> scrolling, resizing, etc. is slow.
> 
> Any clues?
> 
> Best regards,
> 
> Mads

Maybe not a definitive answer, but you might have a clue at
http://stackoverflow.com/questions/841096/slow-selection-in-qtreeview-why
.

-- 
Virgil Dupras


More information about the PyQt mailing list