Sure, this is basically my code.
QPixmap pixmap
("transparentImage.png");
QImage image
("transparentImage.png");
//Create the mask
image = image.createAlphaMask(Qt::AutoColor);
bt
= QBitmap::fromImage(image,Qt
::AutoColor);
pixmap.setMask(bt);
//Aply the mask to the widget
_mainWidget->setMask(pixmap.mask());
QPixmap pixmap("transparentImage.png");
QImage image("transparentImage.png");
QBitmap bt();
//Create the mask
image = image.createAlphaMask(Qt::AutoColor);
bt= QBitmap::fromImage(image,Qt::AutoColor);
pixmap.setMask(bt);
//Aply the mask to the widget
_mainWidget->setMask(pixmap.mask());
To copy to clipboard, switch view to plain text mode
The result in qt 4.1 is that the mask is applied to the mainwidget and the transparent pixel in the image come clipped.
The result in qt 4.2 is that the transparent pixels in the image are black, and looks like the mask is not been applied
Any help plz
THanks
CJC
Bookmarks