def shapeFromPath(path, pen):
 stroker = QPainterPathStroker()
 stroker.setCapStyle(pen.capStyle())
 stroker.setJoinStyle(pen.joinStyle())
 stroker.setMiterLimit(pen.miterLimit())
 stroker.setWidth(max(pen.widthF(), 1e-09))
 shape = stroker.createStroke(path)
 shape.addPath(path)
 return shape

def shapeFromPath ( path , pen ) : stroker = QPainterPathStroker ( ) stroker . setCapStyle ( pen . capStyle ( ) ) stroker . setJoinStyle ( pen . joinStyle ( ) ) stroker . setMiterLimit ( pen . miterLimit ( ) ) stroker . setWidth ( max ( pen . widthF ( ) , 1e-09 ) ) shape = stroker . createStroke ( path ) shape . addPath ( path ) return shape
create a qpainterpath shape from the path drawn with pen .