[Qt-interest] Clipping a polyline

R. Reucher rene.reucher at batcom-it.net
Mon Sep 14 11:36:35 CEST 2009


On Mon, 14 Sep 2009 10:03:30 +0100, Jeremy Sanders wrote:
> Hi - I'd like to clip a polyline before painting it on a paint device. I
> only need to clip with a rectangle. Is there any function in Qt for
> doing this? It looks like QPainterPath::intersected would clip polygons
> to other regions, but I can't see a way of clipping polylines.
What do you mean by "polylines" _exactly_? If it's just a set of points, 
couldn't you clip an implicitly closed QPolygon (created with your set of 
points) and use all but the last point of it to create/draw the (clipped) 
polyline?
-- 
René Reucher
rene.reucher at batcom-it.net
http://www.batcom-it.net/



More information about the Qt-interest-old mailing list