QPainterPath 可用于填充,描边,clipping。
使用方法:QPainterPath一旦创建,直线和曲线都可以被添加入path。
int nRowIndex = EllipseCenter.Y();
int nColumnIndex = EllipseCenter.X();
QPainterPath ellipsePath;
ellipsePath.addEllipse(QPointF(nColumnIndex, nRowIndex), 1, 1);//创建一个半径为(nColumnIndex, nRowIndex),长短轴分别为1,1的椭圆
QPolygonF polygonF = ellipsePath.toFillPolygon();//Converts the path into a polygon and returns the polygon.
QPolygon polygon = polygonF.toPolygon();
for (int i = 0; i <polygon.size(); i++)
{
//依次取出polygon的点
}