PDA

View Full Version : resize graphicsitem



rogerholmes
17th August 2009, 23:46
how do you resize (larger or smaller) a graphicsitem in a view.

yogeshgokul
18th August 2009, 05:11
Use:

void QGraphicsItem::scale ( qreal sx, qreal sy )
Scales the current item transformation by (sx, sy) around its origin. To scale from an arbitrary point (x, y), you need to combine translation and scaling with setTransform().

Example:

// Scale an item by 3x2 from its origin
item->scale(3, 2);
// Scale an item by 3x2 from (x, y)
item->setTransform(QTransform().translate(x, y).scale(3, 2).translate(-x, -y));

rogerholmes
18th August 2009, 05:55
Thank You , I found it to tonite.:)