QGraphicsItem set item pos using Cursor
Solved
General and Desktop
-
Hey
This is odd one.. I know... But what is the proper way to move item to cursor position. Say >
item->setPos(QCursor::pos())
I tried all of the mapFromParent/Global/scene etc. I cant figure out which way I need to map it.
Say mouseReleaseEvent>qDebug() << event; qDebug() << "E" << event->pos(); qDebug() << "M" << QCursor::pos(); qDebug() << "1" << mapFromGlobal(QCursor::pos()); qDebug() << "2" << mapFromParent(QCursor::pos()); qDebug() << "3" << mapToGlobal(QCursor::pos()); qDebug() << "4" << mapToParent(QCursor::pos()); qDebug() << "5" << mapFromScene(QCursor::pos()); qDebug() << "6" << mapToScene(QCursor::pos()); }
Any hints?
-