Qt4: Scale Invariant Contours qgraphicsitem

I draw multiple polygons using the Qt4 GraphicsView frame, and I allow the user to zoom in and out. I would like the polygons to become larger and smaller as the user changes the scale (scale) in the view, but is there a way to make the outline thickness always stay the same?

Thank!

+5
source share
1 answer

Yes, I think there is at least such an opportunity:

You may call

void QPen::setCosmetic ( bool cosmetic )

with a TRUE value on the pen, using a polygon to draw. This property allows you to maintain a constant width regardless of any transformations used on QPainter!

, !

+6

All Articles