I would like to be able to group the rows in a QTableView by a certain colum. For example, if I had a table showing:

Item Price
Hat 10
Belt 5
Suitcase 10
Umbrella 5

I would like to be able to group it by price, and the result would be something like

Item
+ Price 10 (2)
+ Price 5 (2)

And with the nodes expanded

Item
- Price 10 (2)
Hat
Suitcase
- Price 5 (2)
Umbrella
Belt

This would need to be implemented with a QTreeView, of course. Has anyone done this before? Are there any open source projects that does this that I could have a look at?

Any help welcome.

Thanks