[PyQt] hierarchical model for QTreeView

Andreas Pakulat apaku at gmx.de
Fri Jan 4 09:43:20 GMT 2008


On 03.01.08 19:18:45, Doug Luce wrote:
> Outside of QDirModel, I'd like to confirm (or, even better, be told I'm 
> wrong) that the only way to use a hierarchical tree model under QTreeView 
> is by making a custom one as a class.

You're wrong. Check QStandartItemModel and QStandardItem, those can be
used to create a hierarchy of items. 

You only need a custom model if you have a legacy data model that you
want to wrap or if QStandardItemModel doesn't support what you want to
do...

Andreas

-- 
Snow Day -- stay home.


More information about the PyQt mailing list