problem in using QPainterPath class??
-
i use QPainterPath class, a part of my source is:
case Conditional: { path.addRect(0,0,200, 200); path.addRect(90,0,20,20); path.addRect(0,90,20,20); path.addRect(180,90,20,20); path.addRect(90,180,20,20); myPolygon = path.toFillPolygon(); setPolygon(myPolygon); }
but the image of shape is in below:
http://www.mediafire.com/view/9e7jdvt3a5ek3rb/QPainterPathImages.png
my question is why the internal line is created,i want to delete lines,i showed them in below images:
http://www.mediafire.com/view/5p4fy1r6z6a3ycc/QPainterPathImages2.png
please help me,thanks for reply. -
Hi! The documentation for
toFillPolygon
says:The polygon is created by first converting all subpaths to polygons, then using a rewinding technique to make sure that overlapping subpaths can be filled using the correct fill rule.
Note that rewinding inserts addition lines in the polygon so the outline of the fill polygon does not match the outline of the path. -
hi @Wieland whats solution for me?how i can overcome this problem,thanks for reply
-
Why do you convert the path to a filled polygon?
-
@Wieland it is example of Qt ,its name diagramscene thanks for reply