Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Support early interruption of evaluation of expressions in vector ren…
…derer
  • Loading branch information
nyalldawson committed Jun 18, 2021
1 parent ce9bae7 commit e7433f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/vector/qgsvectorlayerrenderer.cpp
Expand Up @@ -393,6 +393,9 @@ bool QgsVectorLayerRenderer::renderInternal( QgsFeatureRenderer *renderer )
}

featureRequest.setFeedback( mInterruptionChecker.get() );
// also set the interruption checker for the expression context, in case the renderer uses some complex expression
// which could benefit from early exit paths...
context.expressionContext().setFeedback( mInterruptionChecker.get() );

QgsFeatureIterator fit = mSource->getFeatures( featureRequest );
// Attach an interruption checker so that iterators that have potentially
Expand All @@ -416,6 +419,7 @@ bool QgsVectorLayerRenderer::renderInternal( QgsFeatureRenderer *renderer )
renderer->paintEffect()->end( context );
}

context.expressionContext().setFeedback( nullptr );
mInterruptionChecker.reset();
return true;
}
Expand Down

0 comments on commit e7433f4

Please sign in to comment.