Don't create new empty tab on double click outside the tab bar

This commit is contained in:
Abs62 2014-04-23 17:45:51 +04:00
parent c8e4138f51
commit 0d60382e98

View file

@ -55,7 +55,9 @@ bool MainTabWidget::eventFilter( QObject * obj, QEvent * ev )
if( ev->type() == QEvent::MouseButtonDblClick )
{
QMouseEvent * mev = static_cast< QMouseEvent *>( ev );
if( tabBar()->tabAt( mev->pos() ) == -1 )
if( mev->y() >= tabBar()->rect().y()
&& mev->y() <= tabBar()->rect().y() + tabBar()->rect().height()
&& tabBar()->tabAt( mev->pos() ) == -1 )
{
emit doubleClicked();
return true;