Is column sub sorting possible in QSortFilterProxyModel?
-
@JonB said in Is column sub sorting possible in QSortFilterProxyModel?:
QSortFilterProxyModel
The number of columns is five. You are currently using QSortFilterProxyModel. I want to use the last two columns as a normal model that can not be sorted.
-
@JonB said in Is column sub sorting possible in QSortFilterProxyModel?:
QSortFilterProxyModel
The number of columns is five. You are currently using QSortFilterProxyModel. I want to use the last two columns as a normal model that can not be sorted.
@Pada_
Sorry, I still don't really understand what you are asking.
You can only use one column at a time to sort by in aQSortFilterProxyModel
(if you want to sort by multiple columns at a time, please say so).
If you want to disallow sorting by some of the columns, you could sub-class to implement that, e.g. overrideQSortFilterProxyModel::sort(int column)
and do nothing for certain values ofcolumn
. -
Just to clarify, do you want:
Number Letter 4 a 2 b 1 c 3 d to be sorted like this (i.e. the second column doesn't change)
Number Letter 1 a 2 b 3 c 4 d Or do you just want people to be unable to sort by Letter and only sort by Number?