ARTICLE DETAIL

资讯详情

深耕网站建设、视觉设计与SEO优化的一线实战洞察。

鼠标位置

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

 

返回列表