PDA

View Full Version : Is QPolygon really just a vector of points?



taraj
26th October 2011, 22:56
Hi,

QPolygon states that it provides a vector of points.

Does this mean I can safely do the following or not?

QVector<QPoints> tmp;

somefunction(tmp);

QPolygon somefunction(QPolygon poly)
{
//do something to the poly
return poly;
}




Thanks.

stampede
26th October 2011, 23:08
QPolygon class has a (non-explicit) constructor that takes a QVector<QPoint> as argument, so your code should compile and work fine.