PDA

View Full Version : QGraphicsPolygonItem Returning line to start



Terabyte
28th December 2008, 17:59
Hey,

I have a QGraphicsPolygonItem, i'm capturing a mouseEvents->scenePos() and <<'ing it to the QGraphicsPolygonItem->polygon()

I'm almost getting what I want, but as I draw, there's always a line from my current position returning to my start position. See pictures where there's a straight line (pointed in red) from the green end point to the blue start point.

Why does this line exist? I dont want the polygon to be closed, i just want a 'freehand line'.
Am I using the correct shape?

Any help to stop this closing line appearing would be excellent.

aamer4yu
29th December 2008, 07:22
How are u adding the QGraphicsPolygonItem to the scene ? can we see the code ?

Or may be you can look at using QGraphicsPathItem . May be QGraphicsPolygonItem closes the polygon.