I have a png with transparency but when I run the application it became white.
Do I have to do something to set the transparency?
I have a png with transparency but when I run the application it became white.
Do I have to do something to set the transparency?
I've a blue background and I see white at the transparency area.
Show us how you're drawing your pixmap. Are you creating a pixmap and painting it to the screen, or are you doing something with QSS?
if (!product["icon"].isEmpty()){
QPixmap* pixmap = new QPixmap(product["icon"]);
QIcon icon(*pixmap);
QSize iconSize(pixmap->width(), pixmap->height());
button->setIconSize(iconSize);
button->setIcon(icon);
button->setFixedSize(pixmap->width(),pixmap->height());
//button->setFlat(true);
}
Apart from superflous use of the new operator this code is fine. The problem has to be elsewhere (e.g. your image is not transparent).
.. or you are viewing your image on top of a white background.
Indeed, please forgive my failure of early morning reading comprehension.
Bookmarks