Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[layertree] fix crash with symbology
  • Loading branch information
wonder-sk committed May 22, 2014
1 parent 9cfaaf1 commit 6b1c7c7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/gui/layertree/qgslayertreemodel.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit 6b1c7c7

Please sign in to comment.