mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-03 00:02:25 -05:00
[QgsQuick] Clean feature layer pair after deleting feature.
This commit is contained in:
parent
01f8b625c9
commit
2f0c935d77
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user