Skip to content
Permalink
Browse files
[layertree] fix crash with symbology
  • Loading branch information
wonder-sk committed May 22, 2014
1 parent 9cfaaf1 commit 6b1c7c79302e9e50b6337a5698d200d8b8e0eb35
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/gui/layertree/qgslayertreemodel.cpp
@@ -553,10 +553,12 @@ void QgsLayerTreeModel::addSymbologyToVectorLayer( QgsLayerTreeLayer* nodeL )
foreach ( XY item, items )
{
QString label = item.first;
QPixmap pix( QgsSymbolLayerV2Utils::symbolPreviewPixmap( item.second, iconSize ) );
if ( showFeatureCount )
QIcon icon;
if ( item.second )
icon = QgsSymbolLayerV2Utils::symbolPreviewPixmap( item.second, iconSize );
if ( showFeatureCount && item.second )
label += QString( " [%1]" ).arg( vlayer->featureCount( item.second ) );
lst << new QgsLayerTreeModelSymbologyNode( nodeL, label, QIcon( pix ) );
lst << new QgsLayerTreeModelSymbologyNode( nodeL, label, icon );
}

endInsertRows();

0 comments on commit 6b1c7c7

Please sign in to comment.