Hi,
I need to create an outline following a curve with a fixed width (said 100), as shown in my attachment 1.
To do this, I use QPainterPathStroker using following code. However, the resulting stroker joins them with the curve (see attachment 2). What I want is the outline without joining with the curve. How can I do so? Thanks!
Qt Code:
QVector<QPointF> myCurve; // <-- myCurve is calculated somewhere else. QPainterPath curvePath; curvePath.moveTo( myCurve[ 0 ] ); for ( int idx = 1; idx < myCurve.size(); idx++ ) { curvePath.lineTo( myCurve[ idx ] ); } QPainterPathStroker stroker; stroker.setCapStyle( Qt::RoundCap ); stroker.setJoinStyle( Qt::RoundJoin ); stroker.setWidth( 100 ); painter->drawPath( outline );To copy to clipboard, switch view to plain text mode
Bookmarks