Refresh table filters when the model is updated. Should resolve Bug #2579.

This commit is contained in:
cc9cii 2015-05-25 09:15:07 +10:00
parent 6402b82823
commit e6d2821b78
3 changed files with 12 additions and 0 deletions

View file

@ -53,3 +53,9 @@ bool CSMWorld::IdTableProxyModel::lessThan(const QModelIndex &left, const QModel
{ {
return QSortFilterProxyModel::lessThan(left, right); return QSortFilterProxyModel::lessThan(left, right);
} }
void CSMWorld::IdTableProxyModel::refreshFilter()
{
updateColumnMap();
invalidateFilter();
}

View file

@ -34,6 +34,8 @@ namespace CSMWorld
void setFilter (const boost::shared_ptr<CSMFilter::Node>& filter); void setFilter (const boost::shared_ptr<CSMFilter::Node>& filter);
void refreshFilter();
protected: protected:
bool lessThan(const QModelIndex &left, const QModelIndex &right) const; bool lessThan(const QModelIndex &left, const QModelIndex &right) const;

View file

@ -649,6 +649,10 @@ void CSVWorld::Table::tableSizeUpdate()
} }
emit tableSizeChanged (size, deleted, modified); emit tableSizeChanged (size, deleted, modified);
// not really related to tableSizeUpdate() but placed here for convenience rather than
// creating a bunch of extra connections & slot
mProxyModel->refreshFilter();
} }
void CSVWorld::Table::selectionSizeUpdate() void CSVWorld::Table::selectionSizeUpdate()