diff options
Diffstat (limited to 'src/widgets/widgets/qtabbar.cpp')
-rw-r--r-- | src/widgets/widgets/qtabbar.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 094e9af0de..dfd1f1022c 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -1496,6 +1496,12 @@ bool QTabBar::event(QEvent *event) } } #endif + } else if (event->type() == QEvent::MouseButtonDblClick) { // ### fixme Qt 6: move to mouseDoubleClickEvent(), here for BC reasons. + const QPoint pos = static_cast<const QMouseEvent *>(event)->pos(); + const bool isEventInCornerButtons = (!d->leftB->isHidden() && d->leftB->geometry().contains(pos)) + || (!d->rightB->isHidden() && d->rightB->geometry().contains(pos)); + if (!isEventInCornerButtons) + emit tabBarDoubleClicked(tabAt(pos)); } return QWidget::event(event); } @@ -1723,23 +1729,6 @@ void QTabBarPrivate::moveTab(int index, int offset) q_func()->update(); } - -/*! - \reimp -*/ -void QTabBar::mouseDoubleClickEvent(QMouseEvent *event) -{ - Q_D(QTabBar); - - const QPoint pos = event->pos(); - const bool isEventInCornerButtons = (!d->leftB->isHidden() && d->leftB->geometry().contains(pos)) - || (!d->rightB->isHidden() && d->rightB->geometry().contains(pos)); - if (!isEventInCornerButtons) { - const int index = tabAt(pos); - emit tabBarDoubleClicked(index); - } -} - /*!\reimp */ void QTabBar::mousePressEvent(QMouseEvent *event) |