diff --git a/src/quickgui/attributes/qgsquickattributemodel.cpp b/src/quickgui/attributes/qgsquickattributemodel.cpp index 48c70ccbae9..b66a0369b22 100644 --- a/src/quickgui/attributes/qgsquickattributemodel.cpp +++ b/src/quickgui/attributes/qgsquickattributemodel.cpp @@ -200,12 +200,18 @@ bool QgsQuickAttributeModel::deleteFeature() rv = false; } - if ( !mFeatureLayerPair.layer()->deleteFeature( mFeatureLayerPair.feature().id() ) ) + bool isDeleted = mFeatureLayerPair.layer()->deleteFeature( mFeatureLayerPair.feature().id() ); + rv = commit(); + + if ( !isDeleted ) QgsMessageLog::logMessage( tr( "Cannot delete feature" ), QStringLiteral( "QgsQuick" ), Qgis::Warning ); - - rv = commit(); + else + { + mFeatureLayerPair = QgsQuickFeatureLayerPair(); + emit featureLayerPairChanged(); + } return rv; }