I know that there are 3 different kind of coordinate system.
The scene coordinate
The view coordinate
The item coordinate
The (0,0) item coordinate, can correspond to the topleft corner or the centre ...etc...
For example, if i add a QGraphicsRectItem in this mode:
|
Source code
|
1
2
3
|
QRectF area(0,0,50,50);
item = new QGraphicsRectItem(area);
serPos(mouseEvent->scenePos());
|
i obtain a rect in my scene that has the (0,0) local coordinate in the topleft corner.
If a write:
|
Source code
|
1
2
3
|
QRectF area(-25,-25,50,50);
item = new QGraphicsRectItem(area);
serPos(mouseEvent->mouseEvent->scenePos());
|
I obtain a rect in my scene that has the (0,0) local coordinate in the centre.
When i resize it, the (0,0) local coordinate changes.
How can i restore the item centre coordinate????
The problem comes if a try ti rotate an item after that i resize it:
|
Source code
|
1
|
setTransform(QTransform().rotate(newrotation));
|
This rotation is made around the (0,0) item coordinate.......and if this change, i don't obtain the right behaviour.
This post has been edited 1 times, last edit by "dreamer" (May 11th 2008, 9:05pm)