Skip to content

Commit

Permalink
count features in legend for rule based renderer, fixes #5768
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Oct 25, 2012
1 parent bd4fd28 commit 558245c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/app/legend/qgslegendlayer.cpp
Expand Up @@ -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 )
{
Expand Down

0 comments on commit 558245c

Please sign in to comment.