PDA

View Full Version : How to draw a arc



ProTonS
8th September 2009, 19:38
Hello, boys.

I would like to draw a arc, you know, just a half circle, I am using setSpanAngle(360*8) and
setStartAngle(16*90) that is ok, its a arc, but it has a line from the beginning to the end, I need only a arc not a pie. I am using a blank line to hide it, but sometimes the line is draw before and the half circle be full again.

Someone has a soluction?

Thanks

Jorge.

andyp
8th September 2009, 20:57
I don't get a pie with this, just the arc

mypainter.drawArc(topleftx,toplefty,diameter,diame ter,startangle,sweep);

where startangle (your degrees * 16) and sweep (180 * 16) are in those ridiculous 16th of a degree units.

ProTonS
9th September 2009, 14:17
Thanks for your time, andyp.

I am using graphics view and a scene to draw my itens, to use a qpainter I think I have to reimplement my drawning.

Well, I will search in the forum about that.

Bye bye.

Lykurg
9th September 2009, 15:41
Depending on your drawing you might also want have a look at QGraphicsPathItem in conjunction with QPainterPath.