[PyQt] Slow selection

Mads Ipsen mads.ipsen at gmail.com
Mon Apr 21 17:31:07 BST 2014


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: large.py
Type: text/x-python
Size: 1878 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140421/33c2c743/attachment.py>


More information about the PyQt mailing list