QIcon background not showing as transparent on QToolButton with custom button background
-
wrote on 20 May 2024, 10:30 last edited by
Hi,
I'm using QT 5.15.7 on an embedded system and I'm having a problem with an icon background on a QToolButton.
I have my own button background images (for button up and down) and on top of that an icon with text beneath it (this is why I'm not using QPushButton btw). Unfortunately, the icon background isn't transparent so the icon is enclosed within a white box which doesn't look great with my custom button background. Does anyone know how to fix this short of me manipulating the icon background myself?
For reference, the icon is a bitmap although I've tried a jpeg and the problem still occurs.
Thanks in advance for any help!
-
Hi @SGaist , I'd already tried changing the image to a Jpeg with a transparent background and it didn't work. Thanks, Roger
@RogerD Jpeg has no transparency.
-
Hi and welcome to devnet,
The most simple is to update your image for it to have a transparent background.
-
Hi and welcome to devnet,
The most simple is to update your image for it to have a transparent background.
-
Hi @SGaist , I'd already tried changing the image to a Jpeg with a transparent background and it didn't work. Thanks, Roger
@RogerD Jpeg has no transparency.
-
wrote on 28 May 2024, 08:08 last edited by
Oh dear, I feel really embarrassed now, for years I thought jpeg backgrounds were transparent (using the magic wand in paint.net) but I can see that isn't the case. I tried a PNG and the button icon is working correctly now, thanks for your help guys.
-
-
1/5