PDA

View Full Version : QGraphicsPolygonItem Points



dacrawler
22nd April 2012, 12:07
Hey,

how do I get the corner points of a given QGraphicsPolygonItem? I couldn't find anything in the documentation.

Thanks

wayfaerer
23rd April 2012, 05:59
I'm not sure what you mean exactly by "corner" points, but you could call QGraphicsPolygonItem::polygon() to get the QPolygonF. Since QPolygonF inherits from QVector<QPointF>, you can use any member functions of QVector to access the points in the polygon. For example:



foreach(QPointF point, yourPolygonItem->polygon())
{
// do stuff to each point
}