QPoint viewPoint = ui->graphicsView->mapFromGlobal(QCursor::pos()); QPointF scenePoint = ui->graphicsView->mapToScene(viewPoint); myWidget->setPos(scenePoint);