When using subclasses of QGraphicsItem, I have found that defining _getitem_ on a subclass will cause parentItem() to fail on a child item. For example:
Running the above code generates the following error:
The above example might seem contrived, but it was the result of about an hour of stripping down a larger application until it became clear what the problem was. So although the solution here is simple (remove _getattr_ from parent class), it is not at all obvious when this is encountered in a real application, and the result is very difficult to debug.