[Qt-interest] QPixmap and alpha-channel

Khizer Kapadia khizerkapadia at hotmail.com
Mon Dec 15 20:28:58 CET 2008


Hi,
First off, I would like declare that I am developing apps for a platform which has qt 2.3 in it (yeah I know its ancient). And I am new with Qt :)
 
What I am trying to achieve is to draw a semi-transparent pushbutton. I have various threads but haven't found a conclusive answer.
 
I have tried two methods, both of them are not working:
1. Set background pixmap to null, set background color to color0. I then initialized QImage with 32-bit png (it was a translucent image) and setAlphaBuffer(1). I then initialized a QPixmap and converted the QImage to that QPixmap. Then I set it as the pushbutton's pixmap. In this case the widget had no pixmap at all, or rather a completely transparent pixmap
 
2. Set background pixmap to null, set background color to color0. Used QPainter::drawImage to draw a QImage with 32-bit png (containing a semi-transparent image) on the pushbutton. The image was drawn, but was opaque.
 
Can any body please direct me to a solution?
 
P.S. I can't use the grabWidget or grabWindow method because the parent window containing the pushbutton will have numerous redraws.
 
Thank You

 
_________________________________________________________________
Send e-mail anywhere. No map, no compass.
http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_anywhere_122008
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20081215/84817224/attachment.html 


More information about the Qt-interest-old mailing list