PDA

View Full Version : How to subclass QAbstractProxyModel



skycrestway
28th February 2008, 23:27
The documentation for QAbstractProxyModel is rather minimal. I am looking for other documentation or an example of how to subclass it.

In particular I want to create a proxy that flattens a hierarchical model. I only want to see the leaf items in a particular view.

wysota
28th February 2008, 23:49
If you want to see leaf subitems of an item, set the rootIndex of the view to the parent of the items you want to see. If you want to flatten a model, look here: http://www.thorsen-consulting.dk/freebies.html

bothorsen
22nd October 2010, 23:35
A couple of people have asked about the FlatProxyModel, so I'll upload it to my website again. The site is now called http://www.fioniasoftware.dk because my old company (Thorsen Consulting) went under during the first year of the finansial crisis.

I'll also write a blog entry on my Qt blog at http://www.fioniasoftware.dk/blog.

If you need this before I get the code uploaded, send a mail to bo@mynewdomainyoucanseeabove and I'll mail you the code.