I suggest you apply a sort filter proxy model between your model and the view so that the view sorts using the proxy. You'll then have access to mapping between the source and the proxy models so that you can operate on any of them.
I suggest you apply a sort filter proxy model between your model and the view so that the view sorts using the proxy. You'll then have access to mapping between the source and the proxy models so that you can operate on any of them.
Quite simple actually... use mapToSource and mapFromSource. See
QSortFilterProxyModel documentaion.
If you have several proxys below each other for sorting on more than one parameter, you need to to mapto/mapfrom starting at the lowest level en go through each proxy to get to your sourcemodel, and then get the index you want!
有没有用过表的关联?
Bookmarks