Skip to content
Permalink
Browse files
composer legend feature counts add only to multi symbol or labeled si…
…ngle symbols
  • Loading branch information
blazek committed Mar 20, 2013
1 parent 981c174 commit 7008cd403b2af4bcaac89fa275099d59d1b179c7
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/core/composer/qgslegendmodel.cpp
@@ -165,7 +165,12 @@ int QgsLegendModel::addVectorLayerItemsV2( QStandardItem* layerItem, QgsVectorLa
QString label = symbolIt->first;
if ( lItem->showFeatureCount() )
{
label += QString( " [%1]" ).arg( vlayer->featureCount( symbolIt->second ) );
// Add counts to multi symbols layers only or labeled single symbols,
// so that single symbol layers are still drawn on single line
if ( lst.size() > 1 || !label.isEmpty() )
{
label += QString( " [%1]" ).arg( vlayer->featureCount( symbolIt->second ) );
}
}
QgsComposerSymbolV2Item* currentSymbolItem = new QgsComposerSymbolV2Item( label );
currentSymbolItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );

0 comments on commit 7008cd4

Please sign in to comment.