PDA

View Full Version : QPainterPath to reduced QPolygon



Lodorot
10th September 2009, 00:20
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:



for (int index = 0;
index < polygon.size();
++index) {
polygon.remove(index);
}



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

Thanks

Lodorot