PDA

View Full Version : Image with transparent backgroung on QLabel



elizabeth.h1
6th June 2012, 13:33
Hi

I want to set image which have transparent background on my label . But the image is not displayed on the label.

I i change the background of the image so it is not transparent, then the image is displayed in my label.

So, what could be the problem with showing image with transparent background ?

here is the code :


QPixmap pix(pathToImg);
myLabel->setPixmap(pix);

sonulohani
6th June 2012, 13:46
This is what you've to do :----->



myLabel->setStyleSheet("QLabel{ background-color: transparent;}");