Skip to content
Permalink
Browse files

Apply featureFilterProvider in QgsVectorLayerDiagramProvider

  • Loading branch information
arnaud-morvan authored and nyalldawson committed Jan 8, 2019
1 parent c97645e commit 355ae77d72646f9edc7e593372d1d2af1cee4ad6
Showing with 6 additions and 1 deletion.
  1. +1 −0 src/core/qgsmaprendererjob.cpp
  2. +5 −1 src/core/qgsvectorlayerdiagramprovider.cpp
@@ -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 );
@@ -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 ) )
{

0 comments on commit 355ae77

Please sign in to comment.
You can’t perform that action at this time.