Resize a QGraphicsItem with the mouse
After put a rectangle in a QGraphicsScene and make it movable with the mouse, how could I resize it with the mouse?
If no one knows an answer, a example could be good too, I'm developing in Python using PYQt4, but the example can be in C++.
My simplified code:
Code:
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
scene.setSceneRect(0, 0, 512, 512)
grview.setScene(scene)
pen
= QPen(Qt.
darkMagenta)pen.setWidth(4)
item.setPen(pen)
scene.addItem(item)
grview.fitInView(scene.sceneRect(), Qt.KeepAspectRatio)
grview.show()
sys.exit(app.exec_())