Hi,
I have three different QTreeWidgets, representing three different folder structures. When I try to clear them all three in a row the application crashes.
The only thing I do is:
self.treeWidget02.clear()
self.treeWidget01.clear()
self.treeWidget03.clear()
Sometimes it clears one and sometimes it clears two, then crashes. Sometimes it can clear them all without crashing. I have not been able to see any pattern too when it crashes and when not.
Have anyone had any similar problems and got a hunch what it could be? When I google it people speak about problem when threading, but I am a student and fairly new to python and pyside. So that is magic to me right now.
Edit1:
It also crashes if I try to do
widgets = [ self.treeWidget01, self.treeWidget02, self.treeWidget03 ]
for widget in widgets:
aList = (range(widget.topLevelItemCount()))#.reverse()
for i in aList[::-1]:
widget.takeTopLevelItem(i)
It looks like it happens when I try to clear / do something in a succession.
Edit2:
Clicked debug with Visual Studios and got this message:
Unhandled exception at 0x000000006E9D2C68 (QtGui4.dll) in mayapy.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.
I guess I am trying to access something that doesn’t exists? How is that possible?
Edit3:
Found out that it have something to do with my selection. But unfortunately it doesn’t help to deselect everything first.