PDA

View Full Version : Resizing QGraphicsItems with the mouse?



rec
6th June 2010, 19:17
I have been playing with the excellent graphics scene classes which easily allows you to create new items, select them with the mouse and then move them around the scene. Fantastic.

However, it seems you cannot resize items using the mouse, so their size remains fixed. Is there something obvious I'm missing here or is it simply not possible? Ideally I'd like to be able to click on the bottom-right hand corner of a selected item and resize it using some form of QRubberBand.

SixDegrees
6th June 2010, 23:47
This capability is not provided. There are simply too many possible variants that would have to be provided to meet all needs. Can the object only be resized in one dimension, or both? Relative to the objects center, or some other fixed point? In item coordinates, scene coordinates, view coordinates or some other system? And that's just for starters.

It isn't difficult to implement such a capability, though. Just override the appropriate mouse events on the item.

aamer4yu
7th June 2010, 06:45
Check for this Fotowall (http://qt-apps.org/content/show.php/Fotowall?content=71316) app on Qt-apps.org.
There is code to resize item, and you get help from it .