From 93f75d1cf5ea69ded3b169cfc76df839b38e8e3c Mon Sep 17 00:00:00 2001 From: yifang Date: Thu, 6 Jan 2022 23:20:03 +0800 Subject: [PATCH] fix:single click mouse position --- articlewebview.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/articlewebview.cc b/articlewebview.cc index 17f94ed3..b1a0e03b 100644 --- a/articlewebview.cc +++ b/articlewebview.cc @@ -105,7 +105,7 @@ void ArticleWebView::singleClickAction(QObject* obj, QMouseEvent * event ) } void ArticleWebView::sendCustomMouseEvent(QObject* obj,QEvent::Type type,QMouseEvent * event){ - QMouseEvent ev( QEvent::MouseButtonDblClick,event->localPos (),event->windowPos (),event->screenPos (), Qt::LeftButton, Qt::LeftButton, event->modifiers(), Qt::MouseEventSynthesizedByApplication ); + QMouseEvent ev( QEvent::MouseButtonDblClick,mapFromGlobal(QCursor::pos()),mapFromGlobal(QCursor::pos()),QCursor::pos(), Qt::LeftButton, Qt::LeftButton, event->modifiers(), Qt::MouseEventSynthesizedByApplication ); QApplication::sendEvent(obj, &ev ); }