[Qt-interest] Background colour for qLabel QPixmap

phil prentice philp.cheer at talktalk.net
Mon Jul 5 17:14:51 CEST 2010


I've just realized that I can use png files with transparency, so I can do it 
simply by setting the background pixels to being transparent.

Thanks

Phil
On Monday 05 July 2010 14:43, phil prentice wrote:
> HI
>   I am doing the following:-
>
> m_rangeLabel = new QLabel("");
> QPixmap OffPixmap(":resources/images/darkGreen.png");
> m_rangeLabel->setPixmap(OffPixmap);
>
> It draws a green round dot as the label which is great.
>
> However it leaves a white background around the (circle)dot which I would
> prefer to be the parent background colour; so all I see is the round dot
> and not a white square with a green dot inside.
>
> How do I achieve this?
> Do I somehow use QPixmap::setMask() to do this or is there a better way?
>
> Help appreciated
>
> Phil
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest



More information about the Qt-interest-old mailing list