赞
踩
QPoint mapFromScene(x, y):
该函数返回某一个位置的坐标值。
首先我们要知道,同一个位置用不同的坐标系来衡量,其坐标值会是不同的。
函数的参数(x, y)是利用QGraphicsScene中的坐标系来衡量的一个位置的坐标值, 函数的返回值是该位置在QGraphicsView窗口坐标系中的坐标值。
一句话总结:函数返回的是一个在QGraphicsScene坐标系中的位置(x,y)在QGraphicsView窗口坐标系中的坐标值。
如果将这个过程反过来,那就是函数QPoint mapToScene(x, y)的作用了。
注意: QGraphicsView有两套坐标系,详见https://blog.csdn.net/qq_43058397/article/details/109143823
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。