From 0879e9b8526783505ffc63a74c588fd1abb015c6 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 4 Oct 2009 12:36:08 +0200 Subject: General (shift +) ctrl tab switch management. This let tab switch work also when webview is not focused :) --- src/mainwindow.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index b7996a3a..60c4a05e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -193,6 +193,10 @@ void MainWindow::postLaunch() connect(m_view, SIGNAL(setCurrentTitle(const QString &)), this, SLOT(slotUpdateWindowTitle(const QString &))); connect(m_view, SIGNAL(printRequested(QWebFrame *)), this, SLOT(printRequested(QWebFrame *))); + // (shift +) ctrl + tab switching + connect(this, SIGNAL(ctrlTabPressed()), m_view, SLOT(nextTab())); + connect(this, SIGNAL(shiftCtrlTabPressed()), m_view, SLOT(previousTab())); + // update toolbar actions signals connect(m_view, SIGNAL(tabsChanged()), this, SLOT(slotUpdateActions())); connect(m_view, SIGNAL(currentChanged(int)), this, SLOT(slotUpdateActions())); @@ -872,6 +876,18 @@ void MainWindow::keyPressEvent(QKeyEvent *event) return; } + if ((event->modifiers() == Qt::ControlModifier) && (event->key() == Qt::Key_Tab)) + { + emit ctrlTabPressed(); + return; + } + + if ((event->modifiers() == Qt::ControlModifier + Qt::ShiftModifier) && (event->key() == Qt::Key_Backtab)) + { + emit shiftCtrlTabPressed(); + return; + } + KMainWindow::keyPressEvent(event); } -- cgit v1.2.1