lliehu
8th December 2007, 15:29
I use a class named SvgIconEngine that is subclassed from QIconEngineV2 to paint the system tray's (QSystemTrayIcon) icon.
SvgIconEngine *engine = new SvgIconEngine;
engine->loadSvgFromFile(":/icon.svg");
mSysTray->setIcon(QIcon(engine) ); // mSysTray = QSystemTrayIcon
The paint code is the following:
void SvgIconEngine::paint(QPainter *painter, const QRect& rect,
QIcon::Mode mode, QIcon::State state)
{
mRenderer.render(painter, rect); // mRenderer = QSvgRenderer object
}
In Windows XP I have this problem:
http://www.kolumbus.fi/lliehu/sekalaista-tavaraa/bad_systemtrayicon.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?
SvgIconEngine *engine = new SvgIconEngine;
engine->loadSvgFromFile(":/icon.svg");
mSysTray->setIcon(QIcon(engine) ); // mSysTray = QSystemTrayIcon
The paint code is the following:
void SvgIconEngine::paint(QPainter *painter, const QRect& rect,
QIcon::Mode mode, QIcon::State state)
{
mRenderer.render(painter, rect); // mRenderer = QSvgRenderer object
}
In Windows XP I have this problem:
http://www.kolumbus.fi/lliehu/sekalaista-tavaraa/bad_systemtrayicon.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?