Skip to content

Commit

Permalink
Apply featureFilterProvider in QgsVectorLayerDiagramProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-morvan committed Jan 9, 2019
1 parent 948048c commit a222906
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/core/qgsmaprendererjob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ LabelRenderJob QgsMapRendererJob::prepareLabelingJob( QPainter *painter, QgsLabe
job.context.setPainter( painter );
job.context.setLabelingEngine( labelingEngine2 );
job.context.setExtent( mSettings.visibleExtent() );
job.context.setFeatureFilterProvider( mFeatureFilterProvider );

// if we can use the cache, let's do it and avoid rendering!
bool hasCache = canUseLabelCache && mCache && mCache->hasCacheImage( LABEL_CACHE_ID );
Expand Down
6 changes: 5 additions & 1 deletion src/core/qgsvectorlayerdiagramprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,13 @@ QList<QgsLabelFeature *> QgsVectorLayerDiagramProvider::labelFeatures( QgsRender
QgsFeatureRequest request;
request.setFilterRect( layerExtent );
request.setSubsetOfAttributes( attributeNames, mFields );
const QgsFeatureFilterProvider *featureFilterProvider = context.featureFilterProvider();
if ( featureFilterProvider )
{
featureFilterProvider->filterFeatures( qobject_cast<QgsVectorLayer *>( mLayer ), request );
}
QgsFeatureIterator fit = mSource->getFeatures( request );


QgsFeature fet;
while ( fit.nextFeature( fet ) )
{
Expand Down

0 comments on commit a222906

Please sign in to comment.