fix:single click mouse position

This commit is contained in:
yifang 2022-01-06 23:20:03 +08:00
parent 4de296b5a6
commit 93f75d1cf5

View file

@ -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 );
}