Skip to content
Permalink
Browse files

count features in legend for rule based renderer, fixes #5768

  • Loading branch information
blazek committed Oct 25, 2012
1 parent bd4fd28 commit 558245c8ba33488815fdc74ed83f0781910e8f90
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/app/legend/qgslegendlayer.cpp
@@ -598,15 +598,16 @@ void QgsLegendLayer::updateItemListCountV2( SymbologyList& itemList, QgsVectorLa
p.setWindowModality( Qt::WindowModal );
int featuresCounted = 0;


layer->select( layer->pendingAllAttributesList(), QgsRectangle(), false, false );
QgsFeature f;
QgsSymbolV2* currentSymbol = 0;

while ( layer->nextFeature( f ) )
{
currentSymbol = renderer->symbolForFeature( f );
mSymbolCountMap[currentSymbol] += 1;
QgsSymbolV2List symbolList = renderer->symbolsForFeature( f );
for ( QgsSymbolV2List::iterator symbolIt = symbolList.begin(); symbolIt != symbolList.end(); ++symbolIt )
{
mSymbolCountMap[*symbolIt] += 1;
}
++featuresCounted;
if ( featuresCounted % 50 == 0 )
{

0 comments on commit 558245c

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