[Qt-interest] Polyline clipping

Andre Haupt andre at bitwigglers.org
Tue Aug 25 09:49:26 CEST 2009


On Tue, Aug 25, 2009 at 02:35:41PM +0100, Sean Harmer wrote:
> Hi Andre,
> 
> On Tuesday 25 Aug 2009 08:28:34 Andre Haupt wrote:
> > Hi all,
> >
> > Is there a way to clip a polyline (non closed QPolygonF) by a rectangle
> > *before* drawing the polyline with QPainter::drawPolyline()?
> >
> > This clipping would of course produce a bunch of new polylines, maybe
> > a QList<QPolygonF>?
> >
> > I did not find such a method in the docs. Or didn't i look hard enough?
> I cannot recall such a method in Qt but it should not be too hard to do this 
> yourself. Fairly simple to find the intersection of two line segments.
Yes, i know that this wouldn't be too hard. I just wondered, if it's already done ;-)

regards,

Andre



More information about the Qt-interest-old mailing list