QStandardItemModel has those method you mentioned already implemented. sort() and findItems() from QStandardItemModel will not work with your reimplementations. It will be much easier if you just reimplement appropriate methods for your (abstract item model based) model. In general you can't sort a map, so you either need to implement artificial mapping or switch from using QMap to QList. If you do the latter, sorting items is equivalent to sorting the data container. There is also one alternative to doing all that - wrap your model in a QSortFilterProxyModel and set that as the model for your view.
Bookmarks