PDA

View Full Version : Scale size of QGraphicsItem without scaling pen width



Lodorot
22nd May 2009, 10:16
Hi,

I've some QGraphicsItem in my QGraphicsScene which should scale by size when calling QGraphicsView::scale() but the pen width should stay the same. Normally when calling QGraphicsView::scale() the pen width gets scaled too.

For example I've got a circle and I want the diameter to be scaled but not the line width of the pen. Is there a more or less simple way doing so but keeping the normal scaling functionality for the other QGraphicsItem? I'm using Qt 4.5.1.

Reimplementing QGraphicsItem::scale(...) doesn't work and QGraphicsItem::ItemIgnoresTransformations keeps the diameter and the line width fixed.


Thank you in advance

Markus

wysota
25th May 2009, 01:18
See QPen::setCosmetic().