It is a function that gets a row index and returns a boolean.
When it returns true the row of the given index is part of the result set, if it returns false the row will not show up.
Your implementation can make that decision on whatever criteria you like.
bool MySortFilterProxyModel
::filterAcceptsRow(int source_row,
const QModelIndex & source_parent
) const {
return source_row % 2 == 1; // accept every second row
}
bool MySortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex & source_parent) const
{
return source_row % 2 == 1; // accept every second row
}
To copy to clipboard, switch view to plain text mode
Cheers,
_
Bookmarks