title: Resize a QGraphicsItem with the mouse
body: <p>After putting a <a href="https://imgur.com/E1zYfwJ" rel="nofollow noreferrer">rectangle</a> in a <code>QGraphicsScene</code> and making it movable with the mouse, how could I resize it with the mouse?</p>
  <p>If no one knows an answer, a example could be good too, I'm developing in Python using <code>PyQt4</code>.</p>
  <p>I know there are questions similar here, but they don't answer me respectively.</p>
  <p>My simplified code:</p>
  <pre class="lang-py prettyprint-override"><code>import sys
  from PyQt4.QtCore import *
  from PyQt4.QtGui import *
  
  app = QApplication(sys.argv)
  
  grview = QGraphicsView()
  scene = QGraphicsScene()
  scene.setSceneRect(0, 0, 512, 512)
  
  scene.addPixmap(QPixmap('01.png'))
  grview.setScene(scene)
  
  item = QGraphicsRectItem(0, 0, 300, 150)
  
  pen = QPen(Qt.darkMagenta)
  pen.setWidth(4)
  item.setPen(pen)
  
  item.setFlag(QGraphicsItem.ItemIsMovable)
  scene.addItem(item)
  
  grview.fitInView(scene.sceneRect(), Qt.KeepAspectRatio)
  
  grview.show()
  
  sys.exit(app.exec_())
  </code></pre>