Middle-click over tab must close tab.

This is standard behavior in pretty much any modern browser.
This commit is contained in:
Julian Depetris Chauvin 2013-01-04 23:18:12 -03:00
parent 43e9417663
commit 09bc4b46bd

View file

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