Skip to content
Permalink
Browse files
Use transparent background color for symbol / symbol layer preview
git-svn-id: http://svn.osgeo.org/qgis/trunk@14811 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Nov 30, 2010
1 parent 77d1fd0 commit b04b187
Showing 1 changed file with 2 additions and 2 deletions.
@@ -226,10 +226,10 @@ QPixmap QgsSymbolLayerV2Utils::symbolPreviewPixmap( QgsSymbolV2* symbol, QSize s
Q_ASSERT( symbol );

QPixmap pixmap( size );
pixmap.fill( Qt::transparent );
QPainter painter;
painter.begin( &pixmap );
painter.setRenderHint( QPainter::Antialiasing );
painter.eraseRect( QRect( QPoint( 0, 0 ), size ) );
symbol->drawPreviewIcon( &painter, size );
painter.end();
return pixmap;
@@ -239,10 +239,10 @@ QPixmap QgsSymbolLayerV2Utils::symbolPreviewPixmap( QgsSymbolV2* symbol, QSize s
QIcon QgsSymbolLayerV2Utils::symbolLayerPreviewIcon( QgsSymbolLayerV2* layer, QgsSymbolV2::OutputUnit u, QSize size )
{
QPixmap pixmap( size );
pixmap.fill( Qt::transparent );
QPainter painter;
painter.begin( &pixmap );
painter.setRenderHint( QPainter::Antialiasing );
painter.eraseRect( QRect( QPoint( 0, 0 ), size ) );
QgsRenderContext renderContext = createRenderContext( &painter );
QgsSymbolV2RenderContext symbolContext( renderContext, u );
layer->drawPreviewIcon( symbolContext, size );

0 comments on commit b04b187

Please sign in to comment.