Given a QPainterPath
how can I stroke the path only on the inside or outside edge of the path (or left- or right-side for non-closed paths)?
QPainter::strokePath()
centers the pen along the path and causes the same amount of ink to fall on both sides. For a visual example of the desired effect, see this graphic I made (for an SVG proposal, not feature):
I don't mind if this is done through some hack like setting the path itself as a clipping region (for inside) or anti-clipping region (for outside).
The goal here is to fill a rounded rectangle with a low-opacity fill and then stroke just outside that with a lower-opacity stroke to simulate a 2-step 'blur' falloff. If the stroke overlaps the fill then the opacity is doubled, ruining the effect. Due to the complex shape a simple scaling of the path would not work well, even though it might work for the circles and rectangles drawn above.