Skip to content
Permalink
Browse files
Update QgsMapToolShowHideLabels to work with new vector api
- Works now, but should have worked before this fix
  • Loading branch information
dakcarto committed Feb 8, 2013
1 parent c90870d commit 3676a384af61bbd3cb3d9e2cfd6b44fd260339d2
Showing with 4 additions and 6 deletions.
  1. +4 −6 src/app/qgsmaptoolshowhidelabels.cpp
@@ -210,16 +210,14 @@ bool QgsMapToolShowHideLabels::selectedFeatures( QgsVectorLayer* vlayer,
QgsDebugMsg( "Selection layer: " + vlayer->name() );
QgsDebugMsg( "Selection polygon: " + selectGeomTrans.exportToWkt() );

QgsFeatureIterator fit = vlayer->getFeatures( QgsFeatureRequest().setFilterRect( selectGeomTrans.boundingBox() ).setFlags( QgsFeatureRequest::NoGeometry | QgsFeatureRequest::ExactIntersect ).setSubsetOfAttributes( QgsAttributeList() ) );
QgsFeatureIterator fit = vlayer->getFeatures( QgsFeatureRequest()
.setFilterRect( selectGeomTrans.boundingBox() )
.setFlags( QgsFeatureRequest::ExactIntersect )
.setSubsetOfAttributes( QgsAttributeList() ) );

QgsFeature f;
while ( fit.nextFeature( f ) )
{
QgsGeometry* g = f.geometry();

if ( !selectGeomTrans.intersects( g ) )
continue;

selectedFeatIds.insert( f.id() );
}

0 comments on commit 3676a38

Please sign in to comment.