开发者

How QRectF::adjusted() works

开发者 https://www.devze.com 2023-01-01 00:33 出处:网络
My custom graphics item has (0,-60 60x60) boundingRect. When I adjust the coordinates with rect.adjusted(-5,-5,5,5)

My custom graphics item has (0,-60 60x60) boundingRect. When I adjust the coordinates with

rect.adjusted(-5,-5,5,5)

new boundingRect retur开发者_开发百科ns (-5,-65,70x70). I read the documentation here and I think boundingRect should return (-5,-65,65x65)

Do I misunderstand the doc?


The trick is in the parameters to the "adjusted".

Initial co-ordinates are (0,-60,60,0) ( since height = 60 & width =60)

when you adjust it with (-5,-5,5,5), the new co-ordinates are (-5,-65,65,5).

So now the width = 70 and the height = 70

0

精彩评论

暂无评论...
验证码 换一张
取 消