获取鼠标点击坐标

This commit is contained in:
2021-02-08 21:54:47 +08:00
parent 582e605e60
commit bc931112fc
6 changed files with 14 additions and 1 deletions
+12
View File
@@ -4,6 +4,7 @@
#include <QPen>
#include <QBrush>
#include <QTimer>
#include <QDebug>
#include "WorkThread.h"
@@ -95,6 +96,17 @@ void Widget::paintEvent(QPaintEvent *)
}
void Widget::mousePressEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
{
qDebug() << event->x();
}
}
void Widget::mainrun_timeout()
{
Widget::update();