PDA

View Full Version : QSystemTrayIcon Redraw Problems



December
7th December 2008, 06:12
Hi All,

I use a QSystemTrayIcon for my program and recently noticed that on KDE and Gnome the transparent parts of the icon get drawn over if anything else shows in front.

For example, my icon shows fine when the program starts. If I right-click another programs icon so the popup menu partially covers my icon, the transparent parts of the icon end up taking the color of the pop-up menu.

It's really annoying and I can't figure out why. I though it might be the PNG I'm using so did a quick test:



pxIcon = new QPixmap(22,22);
pxIcon->fill(Qt::transparent);
QPainter painter(pxIcon);
painter.fillRect(4, 4, 14, 14, QBrush(Qt::red) );

trayicon = new QSystemTrayIcon( *pxIcon, this );


But it still happens.

I'm using a Pixmap instead of an icon as I need to use it for other things in the program too.

Any ideas?

Thanks.