PDA

View Full Version : QPushButton with semi-transparent image



mentalmushroom
22nd June 2012, 15:21
I need to place the image with semi-transparent shadow on the QPushButton. When I try to do this, I still see the buttons background through the semi transparent areas of that image. Is there any way to achieve this other than subclassing QPushButton and reimplementing paintEvent? Also I'd like to avoid applying stylesheets.

I've noticed it works when I set the image as the brush for the button's background role when the button is flat. But background appears again when I click it.

wysota
24th June 2012, 10:25
Subclassing is the best way to go.