
Originally Posted by
alexandrius
Never understood anything from documentation.
Apparently there is something wrong with your reading skills.
Please give me a practical example if you can
bool MySortFilterProxyModel::filterAcceptsRow(int sourceRow,
{
QModelIndex index0
= sourceModel
()->index
(sourceRow,
0, sourceParent
);
QModelIndex index1
= sourceModel
()->index
(sourceRow,
1, sourceParent
);
QModelIndex index2
= sourceModel
()->index
(sourceRow,
2, sourceParent
);
return (sourceModel()->data(index0).toString().contains(filterRegExp())
|| sourceModel()->data(index1).toString().contains(filterRegExp()))
&& dateInRange(sourceModel()->data(index2).toDate());
}
bool MySortFilterProxyModel::filterAcceptsRow(int sourceRow,
const QModelIndex &sourceParent) const
{
QModelIndex index0 = sourceModel()->index(sourceRow, 0, sourceParent);
QModelIndex index1 = sourceModel()->index(sourceRow, 1, sourceParent);
QModelIndex index2 = sourceModel()->index(sourceRow, 2, sourceParent);
return (sourceModel()->data(index0).toString().contains(filterRegExp())
|| sourceModel()->data(index1).toString().contains(filterRegExp()))
&& dateInRange(sourceModel()->data(index2).toDate());
}
To copy to clipboard, switch view to plain text mode
Bookmarks