Position in itemChange
-
Virtual function in QGraphicsItem interface
QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
strangely provides
value
that either in scene or local coordinates. Maybe anyone has idea why?Problem description: At first, when all graphics items get shown,
value
always is in scene coordinate. Moving any item works fine. Then, after move is completed, the next move makesvalue
to be in local coordinate. Visually it appears as sudden jump to the origin (0,0). -
@SGaist Thanks for reply. Yes, like that. I suspect some initialization state on scene/view/items, because after
value
switches to local item coordinates, it says in local coordinates all the time.PS. There is more logic in
itemChange
in fact, but it all commented out to localize the problem. -
@SGaist Thanks for reply. Yes, like that. I suspect some initialization state on scene/view/items, because after
value
switches to local item coordinates, it says in local coordinates all the time.PS. There is more logic in
itemChange
in fact, but it all commented out to localize the problem.