[Qt-interest] Crashing on scrollToBottom

Info info at misafe.com
Wed Aug 19 20:10:38 CEST 2009


Hi,

I'm working through a number of UI problems which seem to have arisen  
since an update to the latest opensource release but that may be  
conincidence.

I have a bug at the moment which is as follows:

I have a QListWidget on a QMainWindow which has items added from it  
from another thread in quick succession. On creation of the  
QMainWindow, I hook up a signal called scrollIntoView() to the  
QListWidget scrollToBottom() slot like this:

connect(this, SIGNAL(scrollIntoView()), ui.ctlMessages,  
SLOT(scrollToBottom()));

In the function which adds the items, I call:

QListWidgetItem *item = new QListWidgetItem(*icon, message);
ui.ctlMessages->addItem(item);
	
emit scrollIntoView();

Now this will work for a while but it will eventually crash with an  
"out of range" exception in qvector.cpp. In the stack trace is  
scrollToBottom(). Is this the correct way to be doing it? Items are  
never removed from the QListWidget so it's not that an item was  
removed before it could scroll.

Any ideas?

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090819/d445df2a/attachment.html 


More information about the Qt-interest-old mailing list