I'm working on a map visualization project and I use Graphics View Framework in order to draw polygons, text, images etc..

What I need to do is that draw polygons with thousands of points with (possibly multiple) polygonian holes which would have hundreds of points. I'm aware that QPolygon::subtract() is the tool for this operation, however it's a really slow/performance killer function.

I need some kind of workaround or an alternative subtract function that is much faster.

Placing an empty/blank polygon with higher z value into the hole is not an option since I'm going to fill those holes with some other multiple polygons which might not have common points with the outer polygon. And what I have is only millions of points.
I'm aware I can increase those inner polygon's z value but in some cases I cannot point that "this polygon is inside this polygon's hole", thus some polygons go missing under the bigger one.
Intersect function is also performance killer.