General question about Proxy Model

"John F Sturtz" <[email protected]>
Newsgroups gmane.comp.python.pyqt-pykde
Message-ID <[email protected]>
Hi again.

I'm the one who started the QTreeView + sort + delete = crash thread on May 8th.  In response to assistance from Kyle and Florian, I've re-implemented to use a QAbstractItemModel with associated QSortFilterProxyModel.

On the whole, that seems to be working pretty well, but there's one thing (well, at least one) I haven't been clear on despite poring over what documentation I can find.  I can post the test code again if it will help, but I think this is more of a general question:

If I have both a source model and also a proxy, and I'm modifying the view in a way that changes the structure (deleting a row, in the current case I'm working on), should I be overriding removeRows() for both the source model and the proxy, and calling beginRemoveRows()/endRemoveRows() in both cases?

I guess that seems to make sense to me, and my initial testing suggests it's so, as it seems to work (whereas if I don't do that, I either get a crash, or a message something like QSortFilterProxyModel: inconsistent changes reported by source model).

Same for inserting rows?  Just checking to see if I'm thinking right here.

Thanks!

/John

_______________________________________________
PyQt mailing list    [email protected]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.