PDA

View Full Version : Flickering



Pembar
19th May 2009, 18:05
Hey guys,

I have a widget which I would like to hide a part of it (at least for a while). I am currently using "setMask" to hide part of the QDialog. Initially the entire widget is supposed to be invisible and slowly I "unmask" the widget. The problem is that when I call "show()", the entire widget flickers out showing the entire widget before disappearing.

I was wondering if there was anyway to avoid that "flicker"?

Thanks much

Regards,
Pembar

aamer4yu
19th May 2009, 18:30
How fast are you unmasking the widget ?

paulocarvalho_br_2009
19th May 2009, 20:21
Take a look at http://doc.trolltech.com/4.5.1/qwidget.html#paintEvent

It says that slow or complex widgets can use PaintEvent::region() to optimize its drawing operation. It returns a rectangular area that must be actually updated. Then you can set a clipping area with QPainter::setClipRegion() so the surrounding area remains unaffected, thus not flickering.