Transparency problems with system tray in Windows
I use a class named SvgIconEngine that is subclassed from QIconEngineV2 to paint the system tray's (QSystemTrayIcon) icon.
Code:
SvgIconEngine *engine = new SvgIconEngine;
engine->loadSvgFromFile(":/icon.svg");
mSysTray
->setIcon
(QIcon(engine
) );
// mSysTray = QSystemTrayIcon
The paint code is the following:
Code:
void SvgIconEngine
::paint(QPainter *painter,
const QRect
& rect,
{
mRenderer.render(painter, rect); // mRenderer = QSvgRenderer object
}
In Windows XP I have this problem:
http://www.kolumbus.fi/lliehu/sekala...emtrayicon.png
Where there should be the transparency there are some weird colorful pixels which undoubtedly are not part of system tray's background.
I have this problem only in Windows. In Linux/KDE everything works perfectly.
Anyone has an idea?
Re: Transparency problems with system tray in Windows
Does it have any effect if you insert the following line:
Code:
void SvgIconEngine
::paint(QPainter *painter,
const QRect
& rect,
{
painter->fillRect(rect, Qt::transparent); // <---
mRenderer.render(painter, rect); // mRenderer = QSvgRenderer object
}
?
PS. Attach images instead of using links to external sites, please.
Re: Transparency problems with system tray in Windows
Quote:
Originally Posted by
jpn
Does it have any effect if you insert the following line:
Code:
painter->fillRect(rect, Qt::transparent); // <---
?
PS. Attach images instead of using links to external sites, please.
No it doesn't. But thanks. And I didn't know you can attach an image. I'll do that next time.