Can I turn sorting on or off in QSortFilterProxyModel?
Solved
General and Desktop
-
Can I turn sorting on or off in QSortFilterProxyModel?
I want to sort the first second column when it is clicked, and sort off when the column is pressed.
@Pada_
There are several possible ways to achieve this. If you have derived your own class, your can override http://doc.qt.io/qt-5/qsortfilterproxymodel.html#sort to decide to do nothing if thecolumn
is not one you want to sort on. Or, you could do the work at the view side instead of in the model if you prefer.