pos() and scenePos() problem
Hi all,
In a QGraphicsScene, I created a QGraphicsPixmapItem object with no parent and set its transformation origin point to the geometrical centre, then a series of transformations were performed by calling setPos() and setRotation().
The weird problem was that, when I translated the object with
Code:
setPos(this->scenePos() + delta)
, the transformation messed up, but
Code:
setPos(this->pos() + delta)
worked fine.
According to the documentation, pos() is the equivalent to calling mapToParent(0, 0), and scenePos() is the equivalent to mapToScene(0, 0). But the result was not: mapToParent(0, 0), mapToScene(0, 0) and scenePos() returned the same coordinates, while pos() returned a different one.
Totally no idea, what is the coordinate returned by pos() then? Could it be a bug with Qt?
Thanks.
Re: pos() and scenePos() problem
Please provide a minimal compilable example reproducing the problem.