problem in using QPainterPath class??
-
wrote on 13 Feb 2016, 16:46 last edited by stackprogramer
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. -
wrote on 13 Feb 2016, 18:52 last edited by
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! 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.wrote on 14 Feb 2016, 06:43 last edited byhi @Wieland whats solution for me?how i can overcome this problem,thanks for reply
-
wrote on 14 Feb 2016, 13:11 last edited by
Why do you convert the path to a filled polygon?
-
Why do you convert the path to a filled polygon?
wrote on 14 Feb 2016, 20:23 last edited by stackprogramer@Wieland it is example of Qt ,its name diagramscene thanks for reply
3/5