[Qt-interest] QListWidget increasingly slow

Ross Driedger ross at earz.ca
Tue Nov 10 20:33:02 CET 2009


On Tue, 10 Nov 2009 13:43:55 -0500, <qt-interest-request at trolltech.com>  
wrote:

> Message: 5
> Date: Tue, 10 Nov 2009 11:43:41 -0700
> From: Bob Hood <bhood2 at comcast.net>
> Subject: [Qt-interest] QListWidget increasingly slow
> To: qt-interest at trolltech.com
> Message-ID: <4AF9B45D.3080605 at comcast.net>
> Content-Type: text/plain; charset="iso-8859-1"
> I'm looking for some advice here.  I'm using a QListWidget as a log
> window, and for short output, it's fine.  However, when I get into
> thousands of lines, it slowly grinds my application to halt as lines are
> added to it.
> I know the culprit, though.  I've narrowed it down to the
> setCurrentRow() method:
>    log_list->addItem(msg);
>     log_list->setCurrentRow(log_list->count() - 1);
> I am using setCurrentRow() to keep the most recent item in the list
> visible to the user as entries are added.

Have you tried using the QListWidget::scrollToItem(...) function?


-- 
"Two things are infinite: the universe and human stupidity; and I'm not  
sure about the the universe."
Albert Einstein


Ross Driedger
ross_at_earz.ca



More information about the Qt-interest-old mailing list