Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Setpos() problem with scene position
V. B. Macit last edited by
I want to put some points when user click and user can drag it that way I add point with this code this is working
ClickPoint=mapToScene(event->pos()); OriginShowedPoint=new vkf2DCephePoint(ClickPoint.x()-Size/2.0, ClickPoint.y()+Size/2.0, Size, Size); scene()->addItem(OriginShowedPoint);
but when I want to re-set position of item with setpos it moves the wrong posion in the scene with this code
I didnt understant what really problem is when the position working with initial position but not working when I try to set position with setPos()
Hi and welcome to devnet,
What do you mean exactly by wrong position ?
V. B. Macit last edited by V. B. Macit
@SGaist hi i am getting the position of clickpoint from event with event->pos() then I map to that point to scene point and I want to drag a point the point which is under curser when i create first the position is right but after I want to move item with set pos it moves to wrong place(not the point selected with mouse curser)
By how much is it off ?