title: Extend QGraphicsItem with pyqt
body: <p>How can I create a class that extend QGraphicsItem to define a new kind of Item?</p>
  
  <p>I'm trying to do that</p>
  
  <pre><code>#!/usr/bin/python
  
  import sys
  from PyQt4 import QtGui
  
  class Node(QtGui.QGraphicsItem):
      def __init__(self, parent = 0):
          self.setFlag(QtGui.QGraphicsItem.ItemIsMovable)
  
  
  app = QtGui.QApplication(sys.argv)
  
  scene = QtGui.QGraphicsScene()
  scene.addText("test")
  
  scene.addItem(Node())
  
  view = QtGui.QGraphicsView(scene)
  view.show()
  
  sys.exit(app.exec_())
  </code></pre>
  
  <p>but i get this error</p>
  
  <pre><code>Traceback (most recent call last):
    File "primo.py", line 15, in &lt;module&gt;
      scene.addItem(Node())
    File "primo.py", line 8, in __init__
      self.setFlag(QtGui.QGraphicsItem.ItemIsMovable)
  RuntimeError: underlying C/C++ object has been deleted    
  </code></pre>
  
  <p>What am I doing wrong? I can't call QGraphicsItem constructor inside the <strong>init</strong> method of Node because QGraphicsItem it's an abstract class</p>