[SOlved] How to make a QIcon transparent ?
-
Hello,
I have a listview with icons how it's explained "here":http://www.developer.nokia.com/Community/Wiki/CS001339_-_QListView_with_icons .
I want to make these icons transparent ?
How can I achieve this ?
Thank you
-
Now I know how to include resources with QRC file but howto make an QIcon transparent ?!
-
Just use a png with an alpha channel and make it transparent where needed. Nothing else required iirc.
-
Oh, yeah, this was very simple, too simple for me to be thought at at first.
Of course this works now, very well. -
A solution in code (event though it slightly misses the point of the question):
@ QPixmap pixmap(16, 16);
pixmap.fill(QColor("black"));
pixmap.setAlphaChannel (pixmap);
QIcon transparentIcon(pixmap);
@