[PyQt] Strange error message with QTreeWidget

Marc Nations mnations.lists at gmail.com
Mon Jan 26 17:37:27 GMT 2009


Hi,
I am getting the following error message and just can not figure out what is
happening to cause it:

Unexpected error: (<type 'exceptions.IndexError'>, IndexError('list index
out of range',), <traceback object at 0x019BE490>)


I have narrowed it down to at least one action...QTreeWidget.clear() and
only after I have used the tree to drag/drop widgets into another tree. If I
perform a clear() action on a freshly populated tree then I don't get the
error. However after the drag/drop is performed then somehow the indexes get
screwed up.

I also tried to clear out the tree by popping all the TreeWidgetItems out
using takeTopLevelItem<http://doc.trolltech.com/4.3/qtreewidget.html#takeTopLevelItem>().
I grabbed the TopLevelItem count and went through a loop grabbing them all.
I got the same error on the last loop. However I'm positive I didn't go
through the loop an extra time. If I had 2 top level items I made sure it
only looped twice.

It's causing a problem once I package the application for deployment because
once the app is closed it always throws up the message that an error has
occurred, check the logs. So I tried to figure out a way to catch the
exception, but I couldn't catch that one using Python try/except. I also
couldn't find a way to turn it off. Anybody have an idea what's going on
here?

Thanks,
Marc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090126/b633cb07/attachment.html


More information about the PyQt mailing list