void Widget::mousePressEvent(QMouseEvent *event)
{
if (event->buttons() == Qt::LeftButton)
{
//输出点击位置相对于当前窗口的坐标
qDebug()<<"event->pos() = "<<event->pos();
//输出点击位置相对于全屏幕的坐标
qDebug()<<"event->globalPos() = "<<event->globalPos();
}
}