dreamer
11th May 2008, 14:44
I'd like to have each rect item on the scene, with the local (0,0) coordinate in the centre of the rect.
If i'd like to obtain a rect item with this attribute, a write:
QRectF area(-25,-25,50,50)
myrect = new rectitem(bla,bla,area);
setPos("pos in the scene where i'd like to put my item")
I build the rect in this mode: QRectF area(-width/2,-height/2,width,height);
The problems come, when i resize the rect.
When i resize it, i use the setRect() function, where i set the new rect.
At the end of resize, the local coordinate (0,0) doesn't match with the centre of my item. How can i obtain this behaviour??
If i'd like to obtain a rect item with this attribute, a write:
QRectF area(-25,-25,50,50)
myrect = new rectitem(bla,bla,area);
setPos("pos in the scene where i'd like to put my item")
I build the rect in this mode: QRectF area(-width/2,-height/2,width,height);
The problems come, when i resize the rect.
When i resize it, i use the setRect() function, where i set the new rect.
At the end of resize, the local coordinate (0,0) doesn't match with the centre of my item. How can i obtain this behaviour??