Tray icon flickering
Valentine Sinitsyn
Valentine.Sinitsyn at usu.ru
Sun Jul 9 15:46:06 CEST 2006
Hi, Will,
WS> No - it's because the draw to the widget is not double buffered.
Uh, really? I thought all Qt widgets are double-buffered by default. I
was thinking about it, but I can't imagine how double buffering can be
of use in this case, because the default scenario for double buffering
widget is approximately as follows:
QPainter p(<some in-memory area to paint>);
p.drawLine(...);
p.drawCircle(...);
...
QPainter p2(<the widget you want to paint on>)
p2.drawPixmap(p1.pixmap())
I.e. you draw something in background then transfer it to the widget
as a pixmap. In case of tray icon, the only thing you need is to draw
the pixmap (via setPixmap() or directly - it does not matter- if you do it in background then switch, it wouldn't be
faster IMHO. Correct me if I'm wrong.
WS> With QMovie the transparent areas of the frame are not cleared before the next
WS> frame is drawn, so you get a smearing overdraw effect. It would work fine if
WS> the animation did not have any transparent areas.
Yup, I was observing this when trying to create Tray with
WF_NoAutoErase. This is also a hint that double-buffering is the
issue.
Regards,
Valentine.
More information about the kde-networkmanager
mailing list