qt-interest@trolltech.com
[Top] [All Lists]

Re: [Qt-interest] drawing polyline with QPainterPath

Subject: Re: [Qt-interest] drawing polyline with QPainterPath
From: Jan
Date: Tue, 02 Jun 2009 11:22:28 +0200
Hi,

> if ( !m_fillPath )
> {
>     path.moveTo( pPrime.at( 0 ) );
>     for ( int i = 1; i < pPrime.size(); ++i )
>         path.lineTo( pPrime.at( i ) );
> }

I tried this before (which did not work i.e. it's still an area).
I am still trying to understand/work with the second part .-)

Thank you
Jan

> else
> {
>     // We need to construct a closed path
>     QPointF zero( 0.0, 0.0 );
>     QPointF zeroPrime = m_coordSystem->mapToPrimed( zero );
>     path.moveTo( pPrime.at( 0 ).x(), zeroPrime.y() );
>     for ( int i = 0; i < pPrime.size(); ++i )
>         path.lineTo( pPrime.at( i ) );
>     path.lineTo( pPrime.last().x(), zeroPrime.y() );
>     path.closeSubpath();
> }
> 
> then later I simply call QPainter::drawPath(). You can ignore my 
> m_coordSystem 
> object it simply transforms my data set into a more convenient coordinate 
> system.
> 
> HTH,
> 
> Sean
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest@xxxxxxxxxxxxx
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
_______________________________________________
Qt-interest mailing list
Qt-interest@xxxxxxxxxxxxx
http://lists.trolltech.com/mailman/listinfo/qt-interest

<Prev in Thread] Current Thread [Next in Thread>