Can i define differnt sort role to each column ?
currently im using SortRule in my QStandardItemModel that is based on Qt::UserRole
but this definition is globally to all the treeview .
can i define different sort rule to each set of vertial cell’s ?
so for example if i have:
the first Group cells will be sorted by Qt::UserRole and the second Id will be sorted by Qt::DisplayRole
wow where can i find example how to do that ?
You can have custom sorting for each column though there is only one sort role for the treeview. You define the sort order by writing values into the custom field that determine the position when sorting. You can even use different types in different columns. Or you can use a specific custom type for every column. Just make sure your custom type is registered with QVariant and defines a comparison operator.