tags:

views:

121

answers:

1

hi geeks,

I want to put a png image as background in QToolButton. But I am not able to get the transparent portions in the button. The transparent portions are showing as white in my QToolButton. Can anybody suggest how to remove the white portions as transparent ?

A: 

I suppose there's something wrong with your png file. The following code:

QToolButton button;
button.setIcon(QIcon("E:/delete.png"));
button.setIconSize(QSize(256, 256));
button.show();

works fine for me (of course E:/delete.png have transparent background).

Make sure you save transparency for your png.

chalup