void QRect::moveCenter ( const QPoint & position )
Moves the rectangle, leaving the center point at the given position. The rectangle's size is unchanged.
See also center().
这个是官方解释,但是为什么我写:
pRect[i].moveCenter(QPoint(xx,yy));
然后是pRect[i]的左上角位于QPoint(xx,yy)的位置?
我就是想把绿色矩形的中心移动到蓝线的交点处
...全文
6613打赏收藏
为什么void QRect::moveCenter 这个函数没有把rect的中心移动到指定点?
void QRect::moveCenter ( const QPoint & position ) Moves the rectangle, leaving the center point at the given position. The rectangle's size is unchanged. See also center(). 这个是官方解释,但是为什么我写: pRect[i].moveCenter(QPoint(xx,yy)); 然后是pRect[i]的左上角位于QPoint