Shortest distance between a QPainterPath and a QPoint
<p>I have a <code>QPainterPath</code> that can hold any sequence of lines and/or cubic bezier curves. Now, I've got a <code>QPoint</code> that I need to calculate the shortest distance between the <code>QPainterPath</code> and the point. Since the path itself does not do much more than storing the elements in order I add them to the path, it doesn't provide such functionality by itself. The only idea I had was to construct a polygon using the <code>QPainterPath::toFillPolygon()</code>, but this sometimes returns me a polygon that is equal to the path and sometimes an empty polygon. Moreover, the <code>QPolygonF</code> object is just a list of points, some of them connected with lines, and some of them are not connected in the original path, but I can't find out which of them are connected and which not.</p>

<p>Is there any (simple) solution to calculate the shortest distance between a <code>QPainterPath</code> (preferably without converting to a polygon) and a <code>QPoint</code>?</p>