[Qt-interest] flicker with updatesEnabled (false)?

Frank Hemer frank at hemer.org
Fri Feb 26 19:31:08 CET 2010


qt4.6.2/linux:

One of my widgets contains a QScrollArea, widgetResizable set to true, with a 
QHBoxLayout.

When adding widgets to the layout dynamically like this:

slot_addWidget () {
   setUpdatesEnabled (false);

   MyWidget * w = new MyWidget ();
   hBoxLayout->insertWidget (hBoxLayout->count (), w);
   w->show ();

   setUpdatesEnabled (true);
}

the whole widget is still flickering ... 

the only way to get rid of the flicker is, to set widgetResizable to false and 
call setGeometry (0, 0, newWidth, newHight) before the 'show ()' call.

This requires me to first calculate the required size where I would have 
expected the layout system to do this.

Why is this - or am I doing sth. wrong here?

Frank



More information about the Qt-interest-old mailing list