[Qt-interest] Does QWidget::setUpdatesEnabled(false) save time

lists4pghanghas lists4pghanghas at gmail.com
Mon Jun 21 20:56:26 CEST 2010


On Monday 21 June 2010 09:31 AM, David Boosalis wrote:
> I sometimes populate a listview or tree view with lots of items.  
> Prior to  the for loop that creates the StandardItems I do a 
> setUpdatesEnabled(false) and then after the for loop I do a 
> setUpdatesEnabled(true). I recall starting this methodoloty with Qt3 
> which relied more on X doing the drawing and was not double buffered.  
> My question is does this still apply to QT 4 now that it does its own 
> rendering.  Further more for widgets that Inherit from a QScrollArea 
> should the ::setUpdatesEnabled() apply to the top window or to the 
> QScrollArea::widget().
>
I think it should still help to reduce your paints if you are gone into 
your population loop for long. Otherwise qt's paint event compression 
should do a pretty good job at compressing all the updates. But  are 
those updates so expensive that you want to freeze your view for long.

As far as I understand QScrollArea, all paint events are handled in its 
viewport. Shouldn't setUpdatesEnabled() be used on viewport.
But again I am relatively new to Qt.
> Do Windows, Mac, and Linux also show the same behavior for this kind 
> of optimization technique (minimize blits to screen).
>
>
> The reason I ask is that I have lots of Table Widgets with real time 
> data feeds and I want to make sure I am minimizing a bunch of screen 
> redraws with one redraw.
>
> Any thoughts  on this is greatly appreciated.
>
> -david
>
>
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>    

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100622/cd6866ea/attachment.html 


More information about the Qt-interest-old mailing list