<br><br><div class="gmail_quote">On Sun, Aug 16, 2009 at 10:34 AM, Alvaro Soliverez <span dir="ltr">&lt;<a href="mailto:asoliverez@gmail.com">asoliverez@gmail.com</a>&gt;</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;">
<br><br><div class="gmail_quote"><div class="im">On Sun, Aug 16, 2009 at 3:09 AM, Cristian Oneţ <span dir="ltr">&lt;<a href="mailto:onet.cristian@gmail.com" target="_blank">onet.cristian@gmail.com</a>&gt;</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>On Sun, Aug 16, 2009 at 3:12 AM, Alvaro Soliverez&lt;<a href="mailto:asoliverez@gmail.com" target="_blank">asoliverez@gmail.com</a>&gt; wrote:<br>
&gt; Hello all,<br>
&gt; I ran into the setUpdatesEnabled problem again.<br>
&gt;<br>
&gt; In the kbudgetview, both lists there call setUpdatesEnabled(false), fill in<br>
&gt; 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><div><br>updateContents() is protected. I tried update() instead, but no luck.<br> </div><div class="im"><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 &quot;...is better, as it permits Qt to optimize for speed and<br>
minimize flicker&quot;. 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></div></blockquote></div><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><div class="im">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><br>
&gt; Both lists don&#39;t show on the screen until I click on a column or an item. If<br>
&gt; I remove the setUpdatesEnabled call, they work fine.<br>
&gt;<br>
&gt; I thought it might be that a parent widget might be calling it too, but my<br>
&gt; search returned empty.<br>
&gt; Do you know where the problem might be?<br>
&gt;<br>
&gt; I think this might be the same problem that the accounts and categories<br>
&gt; 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 &quot;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.&quot;. 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&#39;t have access to my development environment above I was<br>
just guessing, sorry if it&#39;s only noise<br>
</blockquote></div></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>

</blockquote><div><br><br>I removed the setUpdatesEnabled call for all the views that were not working ok, and now they all show up correctly. I commented the lines, so that if we find problems in a future, we remember why it might be.<br>
<br>Regards,<br>Alvaro <br></div></div><br>