<br><br><div class="gmail_quote">On Sun, Aug 16, 2009 at 3:09 AM, Cristian Oneţ <span dir="ltr"><<a href="mailto:onet.cristian@gmail.com">onet.cristian@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Sun, Aug 16, 2009 at 3:12 AM, Alvaro Soliverez<<a href="mailto:asoliverez@gmail.com">asoliverez@gmail.com</a>> wrote:<br>
> Hello all,<br>
> I ran into the setUpdatesEnabled problem again.<br>
><br>
> In the kbudgetview, both lists there call setUpdatesEnabled(false), fill in<br>
> the contents, then call setUpdatesEnabled(true) and repaintContents().<br>
</div>If you try leaving the setUpdatesEnabled calls but instead of<br>
repaintContents() you use updateContents() what happens? </blockquote><div><br>updateContents() is protected. I tried update() instead, but no luck.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
The Qt doc<br>
suggests that calling repaint() (which repaintContents() does)<br>
directly is not recommended and instead update() should be called<br>
because "...is better, as it permits Qt to optimize for speed and<br>
minimize flicker". But calling setUpdatesEnabled(true) implicitly<br>
calls update on the widget so maybe repaintContents() or<br>
updateContents() should not be used. This can be seen in the<br>
difference between:<br>
<a href="http://doc.trolltech.com/3.3/qwidget.html#updatesEnabled-prop" target="_blank">http://doc.trolltech.com/3.3/qwidget.html#updatesEnabled-prop</a><br>
<a href="http://doc.trolltech.com/4.5/qwidget.html#updatesEnabled-prop" target="_blank">http://doc.trolltech.com/4.5/qwidget.html#updatesEnabled-prop</a><br>
The qt3 example has a repaint after setUpdatesEnabled(true) while the<br>
qt4 example doe not have anything after setUpdatesEnabled(true).<br>
<div class="im"></div></blockquote><div><br>Yes, I tried also without anything after setUpdatesEnabled. And you are right, we should remove the repaintContents because it is supposed to call update() anyway.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
> Both lists don't show on the screen until I click on a column or an item. If<br>
> I remove the setUpdatesEnabled call, they work fine.<br>
><br>
> I thought it might be that a parent widget might be calling it too, but my<br>
> search returned empty.<br>
> Do you know where the problem might be?<br>
><br>
> I think this might be the same problem that the accounts and categories<br>
> views are having.<br>
</div>Another thing caught my attention in the difference between the<br>
documentation in qt3 and qt4 of the updatesEnabled property. In qt4 it<br>
is mentioned that "In Qt, widgets normally do not generate screen<br>
flicker, but on X11 the server might erase regions on the screen when<br>
widgets get hidden before they can be replaced by other widgets.<br>
Disabling updates solves this.". But this was not mentioned in the qt3<br>
doc so my suggestion would be to remove the calls to setUpdatesEnabled<br>
and add them only in places where we observe that it is really<br>
necessary.<br>
<br>
Regards,<br>
Cristian<br>
<br>
P.S: I don't have access to my development environment above I was<br>
just guessing, sorry if it's only noise<br>
</blockquote></div><br>Your comments match what I see. So far, removing the call makes it work better. I guess that for some cases, like the register, we will have to deal with it. But in most cases, with only a couple of dozen items at most, we can do without setUpdatesEnabled, at least for now.<br>
<br><br><br><br>