Added some methods for proxy model.

This commit is contained in:
Martin Rotter 2015-06-12 06:49:06 +02:00
parent 5c1915c98b
commit b52e0e7027
2 changed files with 12 additions and 0 deletions

View File

@ -179,6 +179,10 @@ bool FeedsProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right
}
}
bool FeedsProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const {
return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent);
}
QModelIndexList FeedsProxyModel::mapListToSource(const QModelIndexList &indexes) {
QModelIndexList source_indexes;
@ -188,3 +192,7 @@ QModelIndexList FeedsProxyModel::mapListToSource(const QModelIndexList &indexes)
return source_indexes;
}
void FeedsProxyModel::invalidateFilter() {
QSortFilterProxyModel::invalidateFilter();
}

View File

@ -41,9 +41,13 @@ class FeedsProxyModel : public QSortFilterProxyModel {
// Maps list of indexes.
QModelIndexList mapListToSource(const QModelIndexList &indexes);
public slots:
void invalidateFilter();
protected:
// Compares two rows of data.
bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
private:
// Source model pointer.