tags:

views:

1227

answers:

2

I'm pretty new to QGraphicsView in Qt.

As far as I can tell there is no built in way to resize a QGraphicsItem in a scene with a mouse.

What I'm looking for is to be able to resize a QGraphicsRectItem by either dragging out the corners or the edges on screen.

Is there a simple way to do that? Is there a library or a piece of code somewhere online that implements this functionality?

I'm currently using Qt 4.5.1.

+4  A: 

I guess this thread has a similar question. You will have to manually resize the item after intercepting the mousemove events. You can get the 'pos' from 'event' argument like:-

QPointF pt = event->pos()

Use this point 'pt' for resizing to the correct location.

Also lookup the 'Elastic Nodes' application in Qt Demos application. This will help.

Abhay
A: 

I think you should repaint your QGraphicsItem Maybe it could not be simply resizeable

KNP