I have been trying to draw skeletal points of a human using 18 different joints. So, i decided to use QGraphicsPathItem. I could successfully generate the item which looks something like this: (pardon my drawing skills)
To achieve this i used:
QPainterPath pp;
pp.moveTo(m_points[0]);
pp.lineTo(m_points[1]);
pp.lineTo(m_points[2]);
pp.lineTo(m_points[3]);
pp.lineTo(m_points[4]);
pp.moveTo(m_points[1]);
pp.lineTo(m_points[5]);
pp.lineTo(m_points[6]);
pp.lineTo(m_points[7]);
pp.moveTo(m_points[1]);
pp.lineTo(m_points[8]);
pp.lineTo(m_points[9]);
pp.lineTo(m_points[10]);
pp.moveTo(m_points[1]);
pp.lineTo(m_points[11]);
pp.lineTo(m_points[12]);
pp.lineTo(m_points[13]);
pp.moveTo(m_points[0]);
pp.lineTo(m_points[14]);
pp.lineTo(m_points[16]);
pp.moveTo(m_points[0]);
pp.lineTo(m_points[15]);
pp.lineTo(m_points[17]);
m_item->setPath(pp);
At some point of time when i wish to know the positions of the points, i use:
QPolygonF polygon = m_item->path().toFillPolygon();
this returns me 33 points instead of 18.
Is there a way to get the current positions of those 18 points i started with from the path()?
EDIT 1: After comparing the results of toFillPolygon() for an open polygon (start and end points are different) and closed polygon, i realized in an open polygon (as in my case) toFillPolygon() won't work or returns wrong values.

After realizing i cannot get points from
toFillPolygon()i stumbled on this link. It helped me understand we can not extract points fromQPainterPathusingtoFillPolygon()when our path itself is OPEN POLYGON i.e. starting and ending points are different. So, i used something like this:Notice i do not consider the elements
moveTo()but only the elementslineTo()except for the firstmoveTo()element which is my starting position.So, i can get current position of all the 18 points i initially started with to draw the path.