Skip to content
Permalink
Browse files

set default legend raster icon when wms layer to avoid crash

  • Loading branch information
luipir committed Oct 5, 2017
1 parent 82dcc68 commit b3ea17f3e2e8d430775d545bc624650ef3654766
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/core/layertree/qgslayertreemodel.cpp
@@ -227,6 +227,8 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const
if ( testFlag( ShowRasterPreviewIcon ) )
{
QgsRasterLayer* rlayer = qobject_cast<QgsRasterLayer *>( layer );
if ( rlayer->providerType() == "wms" )
return QgsLayerItem::iconRaster();
return QIcon( QPixmap::fromImage( rlayer->previewAsImage( QSize( 32, 32 ) ) ) );
}
else

0 comments on commit b3ea17f

Please sign in to comment.
You can’t perform that action at this time.