From b500b1679b2747a80e98a7f3519cdaa35cda2039 Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Fri, 7 Apr 2023 16:34:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=BB=91=E5=8A=A8=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/list-items/listitem.cpp | 13 ++++++++++--- src/frontend/list-items/listitem.h | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/frontend/list-items/listitem.cpp b/src/frontend/list-items/listitem.cpp index cd42a724..40edfeec 100644 --- a/src/frontend/list-items/listitem.cpp +++ b/src/frontend/list-items/listitem.cpp @@ -179,14 +179,21 @@ void ListItem::showDesktopNotify(const QString &message, QString soundName) void ListItem::mousePressEvent(QMouseEvent *event) { qDebug()<<"[ListItem]"<<"mousePressEvent"; - if (event->button() == Qt::LeftButton) { - onNetButtonClicked(); - } else if (event->button() == Qt::RightButton) { + if (event->button() == Qt::RightButton) { onRightButtonClicked(); } return QFrame::mousePressEvent(event); } +void ListItem::mouseReleaseEvent(QMouseEvent *event) +{ + qDebug()<<"[ListItem]"<<"mouseReleaseEvent"; + if (event->button() == Qt::LeftButton) { + onNetButtonClicked(); + } + return QFrame::mouseReleaseEvent(event); +} + void ListItem::enterEvent(QEvent *event) { // QPalette pal = qApp->palette(); diff --git a/src/frontend/list-items/listitem.h b/src/frontend/list-items/listitem.h index 7789e3b3..598ad1c9 100644 --- a/src/frontend/list-items/listitem.h +++ b/src/frontend/list-items/listitem.h @@ -98,6 +98,7 @@ public: protected: void mousePressEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event); void enterEvent(QEvent *event); void leaveEvent(QEvent *event); void paintEvent(QPaintEvent *event);