You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I override QQmlSortFilterProxyModel::data I can see it is executed only for indices:
QModelIndex(0,0,...)
QModelIndex(1,0,...)
QModelIndex(2,0,...)
with a different roles numbers (e.g. 1 for cost, 0 for name). But never ask for second column (e.g. index QModelIndex(0,1,...)) even if I override columnCount to return hardcoded value 2.
Can you help me to deal with it? Or can you point on the methods that I need to override to make it work properly?
Thanks in advance.
The text was updated successfully, but these errors were encountered:
Hello,
You would need an actual table model (a QAbstractItemModel with multiple columns) as a source model to be able to use SFPM as the model of a TableView. TableModel instead of ListModel for example.
However SortFilterProxyModel only reads the data from the first column for now for sorting and filtering. One would need to do some modifications to filter and sort on multiple columns.
Hello @oKcerG!
What will be your best bet for usage
SortFilterProxyModel
withTableView
directly (sinceSortFilterProxyModel
is subclass ofQAbstractItemModel
)?Expecting to have something like:
If I override
QQmlSortFilterProxyModel::data
I can see it is executed only for indices:QModelIndex(0,0,...)
QModelIndex(1,0,...)
QModelIndex(2,0,...)
with a different roles numbers (e.g.
1
forcost
,0
forname
). But never ask for second column (e.g. indexQModelIndex(0,1,...)
) even if I overridecolumnCount
to return hardcoded value2
.Can you help me to deal with it? Or can you point on the methods that I need to override to make it work properly?
Thanks in advance.
The text was updated successfully, but these errors were encountered: