Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt4: Scale invariant qgraphicsitem outlines

I am drawing some polygons using the Qt4 GraphicsView framework, and I allow the user to zoom in and out of the drawing. I would like the polygons to get larger and smaller as the user changes zoom levels (scale) in the view, but is there a way to make the outline thickness always remain the same?

Thanks!

like image 395
rcv Avatar asked Feb 04 '10 01:02

rcv


1 Answers

Yes I guess there is at least this possibility :

You can call

void QPen::setCosmetic ( bool cosmetic )

with TRUE value on the pen using to draw the polygon. This property allows to keep constant the width regardless of any transformations applied on QPainter !

Hope it helps !

like image 159
Matthieu Avatar answered Oct 21 '22 14:10

Matthieu