[Qt-interest] Slow? painting of rows in QTableWidget

Andreas Pakulat apaku at gmx.de
Wed Mar 25 23:19:05 CET 2009


On 25.03.09 23:11:47, Andrea Franceschini wrote:
> 2009/3/25, Andreas Pakulat <apaku at gmx.de>:
> 
> > You probably don't test the same thing as Sandro, because in your case when
> > the table is shown for the first time it already has all its items in it.
> 
> Either I misunderstand you or you're wrong. If you mean that the rows
> are already in it, then it's correct, but I call t.show() before the
> loop that inserts the items.

But show doesn't show the widget, it only schedules it to be shown during
the next run of the eventloop. Until that happens nothing is actually
drawn. And in your code you're adding the items directly after calling
show, so the eventloop doesn't run in between.

And btw, I didn't mean to say that adding 600 rows when the widget has
already been painted once should be slow.

Andreas
 
-- 
Your domestic life may be harmonious.



More information about the Qt-interest-old mailing list