From 0d60382e9844bece6b0845056206162f1498ad8f Mon Sep 17 00:00:00 2001 From: Abs62 Date: Wed, 23 Apr 2014 17:45:51 +0400 Subject: [PATCH] Don't create new empty tab on double click outside the tab bar --- maintabwidget.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/maintabwidget.cc b/maintabwidget.cc index 91ead9a2..fdf3ca15 100644 --- a/maintabwidget.cc +++ b/maintabwidget.cc @@ -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;