QGraphicsPathItem为什么画出来的弧线还有半径

图片说明
QGraphicsPathItem *thePath = new QGraphicsPathItem;
QRectF newRect(-100, -100, 200, 200);
QPainterPath *painterPath = new QPainterPath;
painterPath->arcTo(newRect, 0, 180);
thePath->setPath(*painterPath);
scene.addItem(thePath);

QPainterPathItem在进行默认初始化时会构建一个空的路径加一个点,这个点的位置就是局部坐标系原点(0,0),这个点即为起点,当你直接向这个item添加路径时就会就会存在这个额外的起始点,你现在把半圆添加进去的话就会是你现在画出来的样子,解决方法是使用moveTo函数从新定位起始点,你的起始点应该需要定位到半圆上。

https://zhidao.baidu.com/question/177484477313214844.html