📅  最后修改于: 2022-03-11 14:44:53.223000             🧑  作者: Mango
QPoint viewPoint = ui->graphicsView->mapFromGlobal(QCursor::pos());
QPointF scenePoint = ui->graphicsView->mapToScene(viewPoint);
myWidget->setPos(scenePoint);