fix: middle button does not work

This commit is contained in:
YiFang Xiao 2024-01-04 20:17:51 +08:00
parent dca702e77d
commit 7420944b9d

View file

@ -80,8 +80,14 @@ bool ArticleWebView::eventFilter( QObject * obj, QEvent * ev )
singleClickAction( pe );
} );
}
if ( pe->buttons() & Qt::MiddleButton )
if ( pe->buttons() & Qt::MiddleButton ) {
midButtonPressed = true;
QTimer::singleShot( 100, this, [ = ]() {
sendCustomMouseEvent( QEvent::MouseButtonPress );
sendCustomMouseEvent( QEvent::MouseButtonRelease );
} );
return false;
}
}
if ( ev->type() == QEvent::MouseButtonRelease ) {
auto pe = dynamic_cast< QMouseEvent * >( ev );