Qt-interest Archive, April 2007
Re: QTreeWidget performance
Message 1 in thread
> I raised the iterations to 2000 and inserted a print out in each iteration and
> I can see that it really slows down when the number of items grow.
> The problem seems to be in the graphics, i.e., in displaying the content. The
> inserting in QTreeWidget itself seems very fast.
See http://doc.trolltech.com/4.2/qwidget.html#updatesEnabled-prop
Aka you'll want to do:
setUpdatesEnabled(false);
Insert_2000_items_in_tree();
setUpdatesEnabled(true);
This will conserve 1999 unnecessary repaints after each insert ;)
Martin Petricek
--
[ signature omitted ]
Message 2 in thread
On Tuesday 24 April 2007 14:30, BH wrote:
> > I raised the iterations to 2000 and inserted a print out in each
> > iteration and I can see that it really slows down when the number of
> > items grow. The problem seems to be in the graphics, i.e., in displaying
> > the content. The inserting in QTreeWidget itself seems very fast.
>
> See http://doc.trolltech.com/4.2/qwidget.html#updatesEnabled-prop
>
> Aka you'll want to do:
> setUpdatesEnabled(false);
> Insert_2000_items_in_tree();
> setUpdatesEnabled(true);
>
> This will conserve 1999 unnecessary repaints after each insert ;)
Please see the previous posts. I insert items when they become ready and want
the user to have some feedback, aka don't have to wait 10 minutes before
something appears on the screen.
As Peter suggested, I will use a timer to do the scrollToItem stuff. Unless
I'm missing something, it seems the only option I have.
Paulo
--
[ signature omitted ]