开发者

Qt4: Scale invariant qgraphicsitem outlines

开发者 https://www.devze.com 2022-12-19 16:33 出处:网络
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 l开

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 l开发者_如何转开发evels (scale) in the view, but is there a way to make the outline thickness always remain the same?

Thanks!


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 !

0

精彩评论

暂无评论...
验证码 换一张
取 消