QRectF :: adjusted()如何工作

时间:2010-05-27 07:44:14

标签: qt qt4

我的自定义图形项目有(0,-60 60x60)boundingRect。 当我用

调整坐标时
rect.adjusted(-5,-5,5,5)

new boundingRect返回(-5,-65,70x70)。 我阅读了文档here,我认为boundingRect应该返回(-5,-65,65x65)
我是否误解了文件?

1 个答案:

答案 0 :(得分:9)

诀窍在于“已调整”的参数。

初始坐标为(0,-60,60,0)(因为高度= 60&宽度= 60)

用(-5,-5,5,5)调整时,新的坐标为(-5,-65,65,5)。

现在 width = 70 height = 70