Skip to content
Permalink
Browse files

connected vector layer signal featureAdded to reloadVisible and filte…

…rFeatures slot instead of datachanged of model since this leaded to unneeded and long reloading after the main model is reloaded

fixes #35927
  • Loading branch information
signedav committed May 5, 2020
1 parent 55110ff commit 842024235ad063c0aa8524d7ba28a301c52c8f40
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/gui/attributetable/qgsattributetablefiltermodel.cpp
@@ -321,22 +321,22 @@ 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 );
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 );
}
else
{
disconnect( mTableModel, &QgsAttributeTableModel::dataChanged, this, &QgsAttributeTableFilterModel::filterFeatures );
disconnect( layer(), &QgsVectorLayer::featureAdded, this, &QgsAttributeTableFilterModel::filterFeatures );
}

mFilterMode = filterMode;

0 comments on commit 8420242

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