Hi everyone,

I'm writing my first app, so I'm sometimes a bit unsure if my approaches are recommended practice.

To expand everything below a selected index in a TreeView with custom QAbstractItemModel, I've done the following (I didn't find a predefined slot for this case, only for expanding one level or the whole tree):

1) expand the index using the slot expand(index)
2) get the number of rows  from TreeModel.rowCount()
3) loop over the rows and get the child indexes from TreeModel.index()
4) go recursively to step 1)

Is that the way to go or do I miss some other, better approach?

Thanks in advance,

Jan
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to