mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
composer legend feature counts add only to multi symbol or labeled single symbols
This commit is contained in:
parent
981c174fb4
commit
7008cd403b
@ -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 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user