QTableView sort by ALL Column,not by single Column
I want My QTableView sort by ALL Column,not by single Column,How can I do this?
1 | 2 | 3
4 | 5 | 6
7 | 8 |
8 | 7 | 6
5 | 4 | 3
2 | 1 |
OK,It seems that Qt do not surpport sort by multiple columns default.
But can subclass QSortFilterProxy and impliments yourself.
"Is it possible to sort on multiple columns in QTableView using QSortFilterProxyModel":http://qt-project.org/forums/viewthread/1349
"QSortFilterProxyModel sort multiple columns":http://stackoverflow.com/questions/10893843/qsortfilterproxymodel-sort-multiple-columns
That is not a table then, but a simple list. How about implementing it as an alternate implementation of a list view?
listview is not for my application,
I use some tableview features,such as:
and itemDelegate and customlize tablemodel
And I found the link above is sort multiple columns but not multiple columns as one list
and subclass QSortFilterProxy to achive is very difficulty for such sort policy
so at last, I manage to sort my Model Data myself,and reset the tableview.