Skip to content
Permalink
Browse files
Speed up the check for valid feature
  • Loading branch information
elpaso committed May 12, 2017
1 parent db89929 commit 1eaf03d3b47ea6dfb8ff390653984595dbbd6987
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/gui/attributetable/qgsattributetabledelegate.cpp
@@ -94,7 +94,12 @@ void QgsAttributeTableDelegate::setModelData( QWidget *editor, QAbstractItemMode
return;

// This fixes https://issues.qgis.org/issues/16492
if ( ! vl->getFeature( fid ).isValid( ) )
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;

0 comments on commit 1eaf03d

Please sign in to comment.