Skip to content
Permalink
Browse files

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

(cherry picked from commit a7de7ed)
  • Loading branch information
nirvn authored and nyalldawson committed Jun 19, 2020
1 parent f2b3f83 commit acaebfd1c02b69a8514ec08b3e65d3bfc891d7ef
Showing with 1 addition and 15 deletions.
  1. +1 −15 src/core/layertree/qgslayertreemodellegendnode.cpp
@@ -278,9 +278,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;
}

@@ -420,18 +417,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 acaebfd

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