Qt-> QGraphicsView-> QGraphicsItem Resize

I am 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 the mouse.

I am looking to be able to resize QGraphicsRectItem by dragging corners or edges on the screen.

Is there an easy way to do this? Is there a library or piece of code somewhere on the Internet that implements this functionality?

I am currently using Qt 4.5.1.

+4
c ++ qt qt4
source share
1 answer

I think this thread has a similar question. You will have to manually resize the element after intercepting the mousemove events. You can get "pos" from the "event" argument, for example: -

QPointF pt = event->pos() 

Use this pt point to resize at the desired location.

Also find the Elastic Nodes app in the Qt Demos app. This will help.

+5
source share

All Articles