[PySide] QSortFilterProxyModel and QListView - indexWidget pointer get deleted when filtering

Matthieu Cadet matthieu.cadet at gmail.com
Mon Jul 28 14:29:24 CEST 2014


Hi PySide guru's

I've a problem with a custom QListView I'm trying to make, here the problem:

I'm using QListView to show a list of QWidget object by using
QListView.setIndexWidget(),
this works pretty fine, but now I want to filter the item model by
using QSortFilterProxyModel()
with .setFilterWildcard() it is not working very well because the second
time the model is filtered
I got error like this :

*RuntimeError: Internal C++ object (PySide.QtGui.QLabel) already deleted.*

Without using filtering and QSortFilterProxyModel everything works fine,
but it seems I'm missing
something with the filtering operation, the indexWidget() is deleted when
using filtering :(

here a sample code where you can reproduce the bug, when list view is
shown, hit 1,2 or 3 keyboard
key to activate filtering ( Backspace to set filtering empty to show all
items )

*https://gist.github.com/66e29df303d1f1825a53.git
<https://gist.github.com/66e29df303d1f1825a53.git>*


Can someone please help me on this? is this a known bug ? or I'm doing it
completely wrong :P

Thanks in advance for your help.

-- 
Matthieu Cadet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20140728/c3b02fb7/attachment.html>


More information about the PySide mailing list