[Qt-interest] QAbstractItemView::scrollToBottom and multiple threads
Stefan Bisplinghoff
bisplinghoff at hia.rwth-aachen.de
Fri May 29 09:48:20 CEST 2009
Hi all!
I use a QListWidget to display some log messages in my application.
The items are added from another single thread.
To keep track of the latest messages, I want to scroll down the list
after each item insertion. So what I do in the worker thread is
m_listWidget->addItem('Some Text');
m_listWidget->scrollToBottom();
This results in a very strange behaviour. If I add several items
successively in a short time, all items are displayed correctly, but the
GUI thread gets very busy (up to 100% CPU). However, the GUI is still
useable, so events are processed.
Moreover, if I add the new list items too fast, the QListWidget throws
an "index out of range" error, while redrawing the widget.
Both errors don't happen, if I omit the scrollToBottom command.
Are there known problems with the insertion of new items while the GUI
thread handles the scrolling?
Regards,
Stefan
P.S.: Using Qt 4.5.1 built with VS2008.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090529/d386144f/attachment.bin
More information about the Qt-interest-old
mailing list