mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 17:24:08 +00:00
Merge pull request #1356 from xiaoyifang/fix/middle-button
fix: middle button does not work
This commit is contained in:
commit
804aa29788
|
@ -80,8 +80,14 @@ bool ArticleWebView::eventFilter( QObject * obj, QEvent * ev )
|
||||||
singleClickAction( pe );
|
singleClickAction( pe );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
if ( pe->buttons() & Qt::MiddleButton )
|
if ( pe->buttons() & Qt::MiddleButton ) {
|
||||||
midButtonPressed = true;
|
midButtonPressed = true;
|
||||||
|
QTimer::singleShot( 100, this, [ = ]() {
|
||||||
|
sendCustomMouseEvent( QEvent::MouseButtonPress );
|
||||||
|
sendCustomMouseEvent( QEvent::MouseButtonRelease );
|
||||||
|
} );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ( ev->type() == QEvent::MouseButtonRelease ) {
|
if ( ev->type() == QEvent::MouseButtonRelease ) {
|
||||||
auto pe = dynamic_cast< QMouseEvent * >( ev );
|
auto pe = dynamic_cast< QMouseEvent * >( ev );
|
||||||
|
|
Loading…
Reference in a new issue