QPainterPathStroker outline problems
Solved
General and Desktop
-
I use QPainterPathStroker to get the outline of a path. The path is composed of multiple straight segments.
When I paint it with a wide pen, I get this:When I produce an outline with QPainterPathStroker with the following code...
QPainterPath p; p.moveTo(_xy_path.first()); for (const auto& pt : _xy_path.path()) p.lineTo(pt); QPainterPathStroker ps; ps.setWidth(_pen.widthF() + dist); ps.setCapStyle(Qt::RoundCap); ps.setJoinStyle(Qt::RoundJoin); return ps.createStroke(p);
and plot the outline, I get this:
Obviously, the "loops" towards the inside of the shape are not what I want. How can these be eliminated?
-
-