mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Remove 'fake' tree view code from layer tree model symbol icon creation
This commit is contained in:
parent
6ddcd39800
commit
a7de7edcbe
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user