Skip to content
Permalink
Browse files

Remove 'fake' tree view code from layer tree model symbol icon creation

  • Loading branch information
nirvn committed Jun 2, 2020
1 parent 6ddcd39 commit a7de7edcbeec4de34363024f4b9f2adfcc52a746
Showing with 1 addition and 15 deletions.
  1. +1 −15 src/core/layertree/qgslayertreemodellegendnode.cpp
@@ -294,9 +294,6 @@ QSize QgsSymbolLegendNode::minimumIconSize( QgsRenderContext *context ) const
if ( hInt > minSz.height() ) minSz.setHeight( hInt );
}

if ( mItem.level() != 0 && !( model() && model()->testFlag( QgsLayerTreeModel::ShowLegendAsTree ) ) )
minSz.setWidth( mItem.level() * INDENT_SIZE + minSz.width() );

return minSz;
}

@@ -463,18 +460,7 @@ QVariant QgsSymbolLegendNode::data( int role ) const
pix.fill( Qt::transparent );
}

if ( mItem.level() == 0 || ( model() && model()->testFlag( QgsLayerTreeModel::ShowLegendAsTree ) ) )
mPixmap = pix;
else
{
// ident the symbol icon to make it look like a tree structure
QPixmap pix2( pix.width() + mItem.level() * INDENT_SIZE, pix.height() );
pix2.fill( Qt::transparent );
QPainter p( &pix2 );
p.drawPixmap( mItem.level() * INDENT_SIZE, 0, pix );
p.end();
mPixmap = pix2;
}
mPixmap = pix;
}
return mPixmap;
}

0 comments on commit a7de7ed

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