Hi,

I've got a QPainterPath which I have to convert to a polygon. I used QPainterPath::toFillPolygon() for doing so.

The problem is that because of arcs in the path this results in a polygon with many points. I don't need this precision. So I wrote a loop to reduce the amout of points:

Qt Code:
  1. for (int index = 0;
  2. index < polygon.size();
  3. ++index) {
  4. polygon.remove(index);
  5. }
To copy to clipboard, switch view to plain text mode 


Is there a better way to get a reduced QPolygon from a QPainterPath?

Thanks

Lodorot