Skip to content
Permalink
Browse files

Merge pull request #36194 from signedav/filterfix_312

Avoid long loading in attributetable on model change
  • Loading branch information
signedav committed May 14, 2020
2 parents ffdd052 + 9c92393 commit 84d7523905b44e6db0f6999f2bb42e8d0d731a23
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/gui/attributetable/qgsattributetablefiltermodel.cpp
@@ -321,22 +321,24 @@ void QgsAttributeTableFilterModel::setFilterMode( FilterMode filterMode )
if ( filterMode == ShowVisible )
{
connect( mCanvas, &QgsMapCanvas::extentsChanged, this, &QgsAttributeTableFilterModel::reloadVisible );
connect( mTableModel, &QgsAttributeTableModel::dataChanged, this, &QgsAttributeTableFilterModel::reloadVisible );
connect( layer(), &QgsVectorLayer::featureAdded, this, &QgsAttributeTableFilterModel::reloadVisible );
//featureDeleted is handled over selectionChanged
generateListOfVisibleFeatures();
}
else
{
disconnect( mCanvas, &QgsMapCanvas::extentsChanged, this, &QgsAttributeTableFilterModel::reloadVisible );
disconnect( mTableModel, &QgsAttributeTableModel::dataChanged, this, &QgsAttributeTableFilterModel::reloadVisible );
disconnect( layer(), &QgsVectorLayer::featureAdded, this, &QgsAttributeTableFilterModel::reloadVisible );
}

if ( filterMode == ShowFilteredList )
{
connect( mTableModel, &QgsAttributeTableModel::dataChanged, this, &QgsAttributeTableFilterModel::filterFeatures );
connect( layer(), &QgsVectorLayer::featureAdded, this, &QgsAttributeTableFilterModel::filterFeatures );
//featureDeleted is handled over selectionChanged
}
else
{
disconnect( mTableModel, &QgsAttributeTableModel::dataChanged, this, &QgsAttributeTableFilterModel::filterFeatures );
disconnect( layer(), &QgsVectorLayer::featureAdded, this, &QgsAttributeTableFilterModel::filterFeatures );
}

mFilterMode = filterMode;

0 comments on commit 84d7523

Please sign in to comment.
You can’t perform that action at this time.