Thanks, Franz.
I spent some time last night going through the KDEUI lib and I found the KIdentityProxyModel and the KCategorizedSortFilterProxyModel, but unfortunately I don't see how they are going to help me yet. But they have given me some ideas.
I have an underlying CAbstractListModel with an attached QTableView. What I'd like to do is view the data from a list model in a QTreeView with arbitrary grouping defined by the user. The user should be able to specify a column (only one at a time, i.e. no nested grouping) to group by and then each unique value in that column would become a new parent node with the relevant original rows are children. Also the "group by" column would be hidden. I found an working online ASP.NET example of the kind of functionality I'm talking about here.
Maybe what I need to do is have a proxy model (inheriting from QSortFilterProxyModel perhaps) on top of the list model which provides extra functionality that is required by the QTreeView, e.g.
QModelIndex parent(const QModelIndex &index) const;
I want to create a generic solution because I have a few tables in my application that would benefit from this functionality. Unfortunately the priority of this job is not high at all so I'm not able to give it too much time right now. I'll post back with further ideas, progress, etc.
Bookmarks