<div class="gmail_quote">On Tue, Mar 10, 2009 at 5:28 PM, Darren Dale <span dir="ltr"><<a href="mailto:dsdale24@gmail.com">dsdale24@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br><br>I am trying to create a simple model and view for a simple nested dictionary like d:<br><br> c1 = {'id':1, 'description':'child 1'}<br> c2 = {'id':2, 'description':'child 2'}<br>
d = {'id':0, 'description':'whatever', 'children':[c1, c2]}<br><br>I have a self-contained, relatively simple script attached. When I run it and try to open the top-level entry by clicking on the +, I get errors like:<br>
<br>Traceback (most recent call last):<br> File "tree_test.py", line 111, in parent<br> parent = index.internalPointer().parent<br>AttributeError: 'ItemDataRole' object has no attribute 'parent'<br>
Traceback (most recent call last):<br> File "tree_test.py", line 111, in parent<br> parent = index.internalPointer().parent<br>AttributeError: parent<br><br>Traceback (most recent call last):<br> File "tree_test.py", line 111, in parent<br>
parent = index.internalPointer().parent<br>AttributeError: 'exceptions.AttributeError' object has no attribute 'parent'<br>Bus error<br><br>sometimes I get a different error:<br><br>Traceback (most recent call last):<br>
File "tree_test.py", line 111, in parent<br> parent = index.internalPointer().parent<br>AttributeError: 'ItemDataRole' object has no attribute 'parent'<br>Segmentation fault<br><br><br>Could anyone please help me understand what is happening? I dont understand why index.internalPointer() is returning an ItemDataRole object or an exceptions.AttributeError object.<br>
<br>Im running Qt-4.5.0, sip-4.7.9 and PyQt-4.4.4.<font color="#888888"></font></blockquote><div><br>I just checked this script on a 64-bit kubuntu intrepid system with qt-4.4.3 and PyQt4-4.4.4, sip-4.7.9 and python-2.5.2 and I get segfaults here too. I guess that rules out some issue specific to qt-4.5.<br>
<br>Darren<br></div></div>