Skip to content

Commit

Permalink
Remove 'fake' tree view code from layer tree model symbol icon creation
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jun 2, 2020
1 parent 6ddcd39 commit a7de7ed
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/core/layertree/qgslayertreemodellegendnode.cpp
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit a7de7ed

Please sign in to comment.