From 042df3ecd08e35ae17df104d0b760959afe9c727 Mon Sep 17 00:00:00 2001 From: David Signer Date: Tue, 5 May 2020 09:58:46 +0200 Subject: [PATCH] connected vector layer signal featureAdded to reloadVisible and filterFeatures slot instead of datachanged of model since this leaded to unneeded and long reloading after the main model is reloaded fixes #35927 --- src/gui/attributetable/qgsattributetablefiltermodel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/attributetable/qgsattributetablefiltermodel.cpp b/src/gui/attributetable/qgsattributetablefiltermodel.cpp index f76fb5b31310..20ee6b505d27 100644 --- a/src/gui/attributetable/qgsattributetablefiltermodel.cpp +++ b/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;