Hi Guys,

I've been looking around for a while to see if I can get my QAbstractItemModel to group and/or sum given a defined column in the model. I my case I have a model with three columns from a ledger system - account number, account name, amount. I may have say ten rows in the model, but if those ten rows contains only entries from two accounts I want to show only two rows with the account number, account name and the sum of the amount. Basically exactly like a Group By statement in SQL, but in memory.

I've had a look to the QSortFilterProxyModel to put on top of the model I already have but I can't get it to group/sum - which means I haven't found an example yet that shows this.

I will be truely greatfull if someone sould share his/hers experience with grouping rows in QAbstractItemModel.

Thanks