diff --git a/src/lib/app/browserwindow.cpp b/src/lib/app/browserwindow.cpp index 64c7bfb14..227cceaed 100644 --- a/src/lib/app/browserwindow.cpp +++ b/src/lib/app/browserwindow.cpp @@ -1344,15 +1344,13 @@ void BrowserWindow::keyPressEvent(QKeyEvent* event) case Qt::Key_Tab: if (event->modifiers() == Qt::ControlModifier) { - m_tabWidget->nextTab(); - event->accept(); + QApplication::sendEvent(m_tabWidget, event); } break; case Qt::Key_Backtab: if (event->modifiers() == (Qt::ControlModifier + Qt::ShiftModifier)) { - m_tabWidget->previousTab(); - event->accept(); + QApplication::sendEvent(m_tabWidget, event); } break; diff --git a/src/lib/tabwidget/tabwidget.cpp b/src/lib/tabwidget/tabwidget.cpp index c0c07c413..4a0c53a00 100644 --- a/src/lib/tabwidget/tabwidget.cpp +++ b/src/lib/tabwidget/tabwidget.cpp @@ -538,14 +538,12 @@ void TabWidget::setCurrentIndex(int index) void TabWidget::nextTab() { - QKeyEvent fakeEvent(QKeyEvent::KeyPress, Qt::Key_Tab, Qt::ControlModifier); - keyPressEvent(&fakeEvent); + setCurrentIndex((currentIndex() + 1) % count()); } void TabWidget::previousTab() { - QKeyEvent fakeEvent(QKeyEvent::KeyPress, Qt::Key_Backtab, QFlags(Qt::ControlModifier + Qt::ShiftModifier)); - keyPressEvent(&fakeEvent); + setCurrentIndex(currentIndex() == 0 ? count() - 1 : currentIndex() - 1); } int TabWidget::normalTabsCount() const