Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How QRectF::adjusted() works

Tags:

qt

qt4

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

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

new boundingRect returns (-5,-65,70x70). I read the documentation here and I think boundingRect should return (-5,-65,65x65)
Do I misunderstand the doc?

like image 406
onurozcelik Avatar asked May 27 '10 07:05

onurozcelik


1 Answers

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

like image 139
Jujjuru Avatar answered Oct 01 '22 12:10

Jujjuru