Hello,
I'll answer myself in case somebody needs the same thing in the future..
You map the global coordinates to the view:
QPoint relativePos
= view
->mapFromGlobal
(pos
);
QPoint relativePos = view->mapFromGlobal(pos);
To copy to clipboard, switch view to plain text mode
Then the view local coordinates to the scene:
QPointF scenePos
= graphicsView
->mapToScene
(relativePos
);
QPointF scenePos = graphicsView->mapToScene(relativePos);
To copy to clipboard, switch view to plain text mode
And finally the scene pos to the GraphicsItem pos
QPointF sceneRelPos
= item
->mapFromScene
(scenePos
);
QPointF sceneRelPos = item->mapFromScene(scenePos);
To copy to clipboard, switch view to plain text mode
Now proxy->widget()->childAt(sceneRelPos.toPoint) will return the widget that was hit inside the proxy.
Cheers
Geovani
Bookmarks