[Qt-interest] multi-level sort in QListView?

Andre Somers andre at familiesomers.nl
Thu Jan 21 11:17:57 CET 2010


Andy Brice wrote:
> Has anyone implemented a multi-level sort in QListView i.e. sort on 
> column A then column B?  I realise I could do it in QTableView without 
> too much trouble, but I don't want rip out the QListView I already have.
>
>   

Simply insert a QSortFilterModel proxy between your current model and 
the view. By subclassing it, you can do the sorting any way you like. 
Reimplement the lessThan method to make the proxy do what you want.

André




More information about the Qt-interest-old mailing list