PDA

View Full Version : toFillPolygon



sajis997
19th January 2012, 15:28
Hello forum,

Please Check the following code:




QPolygonF myPolygon;
QGraphicsEllipseItem item(-100,-50,200,100);
myPolygon = item.shape().toFillPolygon();




QPolygonF is nothing but a vector of QPointF.

In that case can i visualize myPolygon as a dotted ellipse ?



Regards
Sajjad

stampede
19th January 2012, 15:40
Maybe just set a proper brush and pen style for QPainter when drawing the ellipse item ? Why do you need the "toFillPolygon()" ?

sajis997
19th January 2012, 15:50
i need to do some intersection testing or draw arrow item from the border of the ellipse when the user press on elliptical item

ChrisW67
20th January 2012, 02:38
Was the simple maths from your earlier Decide the arrow graphics item's docking point not suitable?

Now that you have the ellipse as a polygon the approach used in the Diagram Scene Example may work for you.