鼠标位置

//获取鼠标位置
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);

 

posted @ 2025-11-26 09:19  家煜宝宝  阅读(0)  评论(0)    收藏  举报