Results 1 to 3 of 3

Thread: Transparency problems with system tray in Windows

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2007
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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.

    Qt Code:
    1. SvgIconEngine *engine = new SvgIconEngine;
    2. engine->loadSvgFromFile(":/icon.svg");
    3. mSysTray->setIcon(QIcon(engine) ); // mSysTray = QSystemTrayIcon
    To copy to clipboard, switch view to plain text mode 

    The paint code is the following:

    Qt Code:
    1. void SvgIconEngine::paint(QPainter *painter, const QRect& rect,
    2. QIcon::Mode mode, QIcon::State state)
    3. {
    4. mRenderer.render(painter, rect); // mRenderer = QSvgRenderer object
    5. }
    To copy to clipboard, switch view to plain text mode 

    In Windows XP I have this problem:


    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?
    Last edited by lliehu; 8th December 2007 at 14:34. Reason: made it clear I'm using QSystemTrayIcon

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.