diff --git a/src/gui/attributetable/qgsattributetabledelegate.cpp b/src/gui/attributetable/qgsattributetabledelegate.cpp index caf03f583ba4..7bb8b0d90799 100644 --- a/src/gui/attributetable/qgsattributetabledelegate.cpp +++ b/src/gui/attributetable/qgsattributetabledelegate.cpp @@ -94,6 +94,18 @@ void QgsAttributeTableDelegate::setModelData( QWidget *editor, QAbstractItemMode if ( !eww ) return; + // This fixes https://issues.qgis.org/issues/16492 + QgsFeatureRequest request( fid ); + request.setFlags( QgsFeatureRequest::NoGeometry ); + request.setSubsetOfAttributes( QgsAttributeList( ) ); + QgsFeature feature; + vl->getFeatures( request ).nextFeature( feature ); + if ( ! feature.isValid( ) ) + { + // Model is out of sync (again!). + return; + } + newValue = eww->value(); if (( oldValue != newValue && newValue.isValid() ) || oldValue.isNull() != newValue.isNull() )