ultr
11th March 2009, 20:24
Hello,
I use this code (Qt3) to draw two QIconSet-s (16x16) side by side on a transparent QPixmap, and then make another QIconSet (32x16) from it.
QPixmap pixmap( 32, 16 );
pixmap.fill( Qt::white );
QBitmap emptymask( 32, 16 );
emptymask.fill( Qt::color0 );
pixmap.setMask( emptymask );
QPainter painter( &pixmap );
painter.drawPixmap( QRect( 0, 0, 16, 16 ), icon1.pixmap() );
painter.drawPixmap( QRect( 16, 0, 16, 16 ), icon2.pixmap() );
return QIconSet( pixmap );
However the returned QIconSet is whole transparent.
When I comment out the QBitmap mask setting part (lines 4-6), the two small icons are drawn as expected, but the returned QIconSet has non-transparent, white background.
Is there a way to solve this?
I use this code (Qt3) to draw two QIconSet-s (16x16) side by side on a transparent QPixmap, and then make another QIconSet (32x16) from it.
QPixmap pixmap( 32, 16 );
pixmap.fill( Qt::white );
QBitmap emptymask( 32, 16 );
emptymask.fill( Qt::color0 );
pixmap.setMask( emptymask );
QPainter painter( &pixmap );
painter.drawPixmap( QRect( 0, 0, 16, 16 ), icon1.pixmap() );
painter.drawPixmap( QRect( 16, 0, 16, 16 ), icon2.pixmap() );
return QIconSet( pixmap );
However the returned QIconSet is whole transparent.
When I comment out the QBitmap mask setting part (lines 4-6), the two small icons are drawn as expected, but the returned QIconSet has non-transparent, white background.
Is there a way to solve this?