Important: Please read the Qt Code of Conduct -

QPainterPath will not add a null element

  • AFAIK it is undocumented that appending a null element, for example a lineTo(the current end point of the path), doesn't actually add anything to a QPainterPath.

    path = QPainterPath(QPointF(0,0))
    previousCount = path.elementCount()
    assert path.elementCount() > previousCount@

    The assertion fails. I can understand the reason for it, but it did catch me by surprise.

Log in to reply