[PySide] PySide Pitfalls

Nathan Warmerdam nathan.warmerdam at gmail.com
Tue Sep 16 19:41:31 CEST 2014


Success!  I figured out my crash and fixed it.

Using the hints supplied here on this mailing list I was able to narrow
down the problem and figure it out through a little trial and error.  So
here is my contribution to the "PySide Gotchas":

Beware populating a QListWidget using the addItems method.  In my case I
was calling "clear()" and "addItems" with a list of strings quite
frequently.  The crash tended to happen shortly after this code would
execute (but never exactly at that point).  When I changed this to use a
loop with QListWidgetItem(string, some_list_widget), my crash went away.

I'm assuming this has to do with explicitly making the QListWdigetItem
instead of having it implicitly made behind the scenes, but that is pure
speculation.  You can certainly argue that perhaps I'm not using the
QListWidget correctly but the above scenario should still be noted.

Thanks again for all the tips!
Nathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20140916/52faaae1/attachment.html>


More information about the PySide mailing list