Transparent Image not displaying correctly in QLabel
-
wrote on 27 Aug 2021, 15:34 last edited by
-
wrote on 27 Aug 2021, 16:02 last edited by
yourlabel->setAutoFillBackground(false);
-
I placed a transparent image inside a QLabel:
And when I run my app, I get this:
Do transparent images not work in QLabels? If not, is there another mechanism/object that facilitates this?
@Driftwood
are you sure your image is transparent?
to me your example rather looks like the image contains the checker pattern and no transparency
(Qt doesnt draw a checker pattern) -
wrote on 27 Aug 2021, 18:40 last edited by
Setting that to True or False bears the same result. I've done all I know, including using other transparent images, and I can't get...wait! I just got one to work. Now if I can only remember what I did to make that happen :D
Just kidding. I got an image that loses the transparent background, the checkered area.
Thanks again for your help, JoeCFD.
-
@Driftwood
are you sure your image is transparent?
to me your example rather looks like the image contains the checker pattern and no transparency
(Qt doesnt draw a checker pattern)wrote on 27 Aug 2021, 18:45 last edited by DriftwoodThe checkered background, aside from other things, signifies image area that's transparent. By all rights, it shld vanish completely and allow the app bg color to fill in. I can only guess that some of the stock images were incorrectly created as being why I had trouble. But the last one, shown above, worked as expected. Thanks for your input. That's what got me thinking abt the legitimacy of the image's transparency.
1/5