mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Middle-click over tab must close tab.
This is standard behavior in pretty much any modern browser.
This commit is contained in:
parent
43e9417663
commit
09bc4b46bd
|
@ -61,5 +61,16 @@ bool MainTabWidget::eventFilter( QObject * obj, QEvent * ev )
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if( obj == tabBar() && ev->type() == QEvent::MouseButtonPress )
|
||||
{
|
||||
QMouseEvent * mev = static_cast< QMouseEvent *>( ev );
|
||||
if( mev->button() == Qt::MiddleButton )
|
||||
{
|
||||
emit tabCloseRequested( tabBar()->tabAt( mev->pos() ) );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return QTabWidget::eventFilter( obj, ev );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue