[PyQt] QSortFilterProxyModel.createIndex from within a slot callback

Mark Summerfield mark at qtrac.eu
Fri Feb 27 17:41:48 GMT 2009


On 2009-02-27, Zorg 421 wrote:
> Hello PyQt users, I do not know how to use the third argument of
> createIndex in the following code.

I didn't have time to look at your code, but the third argument must be
a QModelIndex, specifically the model index of the relevant item's
_parent_. For top-level items this is easy: QModelIndex(); but inside
the method using index.parent() should work fine.


-- 
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
    C++, Python, Qt, PyQt - training and consultancy
        "Programming in Python 3" - ISBN 0137129297



More information about the PyQt mailing list