Is it possible to set QLabel background color and add transparent image to it?
Unsolved
General and Desktop
-
Hi,
One way that comes to mind is to overwrite the paintEvent. In it fill the widget with red and then draw the image on top.
-
I am not sure I understand the problem:
- You can always set pixmap which may have transparent color (created from the image). In this case all you need to change background of the QLabel (for example using stylesheet)
- Above way is good in most cases, but if your pixmap size is very different from label size, and you really want perfect look and scalability of the button you follow SGaist's suggestion and draw ellipse in the paint event instead using pixmap.