title: Qt dragging item at scene position while moving
body: <p>Dragging qgraphicsitem around scene can be done in several ways. But the most interesting to me is with attaching flag "itemIsMovable" cause it should be more "native" with Qt library.</p>
  
  <p>My question is; while item is dragging what should be way to print it's position? Remember, we have already flag, the item is moving and position is returning somewhere.</p>
  
  <p>Down is the example. Problem is how to interactively update connected line between rectangle and circle (use toolbar icon to add circle with connected line).</p>
  
  <pre><code>import sys
  from PySide import QtCore, QtGui
  
  class drawCircle(QtGui.QGraphicsItem):
      def __init__(self, scene):
          self.Circle = QtGui.QGraphicsEllipseItem(-20, -20, 40, 40)
          self.Circle.setPos(50,50)
          self.Circle.setFlag(QtGui.QGraphicsItem.ItemIsMovable)
          scene.addItem(self.Circle)
  
          self.Line = QtGui.QGraphicsLineItem(-20, -20, 40, 40)
          self.Line.setLine(0, 0, self.Circle.pos().x(), self.Circle.pos().y())
          scene.addItem(self.Line)
  
  class winScene(QtGui.QGraphicsScene):
      def __init__(self):
          super(winScene, self).__init__()
          self.setSceneRect(0,0,450,200)
          self.addItem(QtGui.QGraphicsRectItem(-20, -20, 40, 40))
  
  class SceneWindow(QtGui.QMainWindow):
      def __init__(self):
          super(SceneWindow, self).__init__()
          self.DefineSceneWindow()
  
      def DefineSceneWindow(self):
          self.SchSc = winScene()
          view = QtGui.QGraphicsView(self.SchSc)
          view.setRenderHint(QtGui.QPainter.Antialiasing)
          view.scale(1,1)
          self.setCentralWidget(view)
          self.setGeometry(0, 300, 500, 300)
          self.show()
  
          self.drRect = QtGui.QAction(QtGui.QIcon('paint_brush.png'), 'Draw Circle', self)
          self.drRect.setShortcut('Ctrl+R')
          self.drRect.triggered.connect(self.DefineAction)
  
          self.toolbar = self.addToolBar('tools')
          self.toolbar.addAction(self.drRect)
  
      def DefineAction(self):
          drawCircle(self.SchSc)
  
  def main():
      app = QtGui.QApplication(sys.argv)
      ex = SceneWindow()
      sys.exit(app.exec_())
  
  if __name__ == '__main__':
      main()
  </code></pre>