//获取鼠标位置 QPoint pos = QCursor::pos(); //X位置 double xpos = pos.x(); //Y位置 double ypos = pos.y();QString str1123; str1123 .append("x=").append(QString::number(xpos)).append(",y=").append(QString::number(ypos)); QMessageBox::information(this, u8"鼠标位置", str1123);