Skip to content
Permalink
Browse files

Merge pull request #36354 from signedav/filterfix_310

Avoid long loading in attributetable on model change
  • Loading branch information
signedav committed May 14, 2020
2 parents 448778a + fc8b3a1 commit 6153b2ffb2751547685173f64cc20838525f4862
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 6153b2f

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