I have a hierarchical model (subclassed QAbstractItemModel) and want to display it in different itemviews. One of these views is a standard QTreeView. For another view I would like to display the hierarchical model as a flat model. With this I mean, I would like to display only leaf items (those that have no children) in either a QTableView or QListView.

Does anyone know how to accomplish this? I do not want to make a new flat model class for this, because I want to use the same model and selection model between all views. I only want to view my hierarchical model as a flat leaf model.

tnx in advance