[PyQt] Slow selection
mads.ipsen at gmail.com
Mon Apr 21 17:31:07 BST 2014
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
* 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
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1878 bytes
Desc: not available
More information about the PyQt