Skip to content

Commit

Permalink
Speed up the check for valid feature
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed May 12, 2017
1 parent db89929 commit 1eaf03d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/gui/attributetable/qgsattributetabledelegate.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 1eaf03d

Please sign in to comment.