[Qt-interest] Clipping a polyline

Jeremy Sanders jeremy at jeremysanders.net
Mon Sep 14 11:03:30 CEST 2009


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.

I want to clip before sending to paint device because the Qt paint engines 
don't seem intelligent enough to do this. For instance, the PDF engine sends 
all the unclipped data to the output file, which can be very large. This is 
pretty important for the SVG output engine, which doesn't support clipping.

Jeremy

-- 
Jeremy Sanders <jeremy at jeremysanders.net>




More information about the Qt-interest-old mailing list