From 0f11df2f16d30ed5edcd0db1f129078bd02338c5 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 7 Jan 2009 17:09:53 +0100 Subject: Removed setFocus from lineEdit->currentWebview so that people can switch trough tabs with CTRL tabbing --- src/tabwidget.cpp | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'src/tabwidget.cpp') diff --git a/src/tabwidget.cpp b/src/tabwidget.cpp index 3a26266b..4af3ef60 100644 --- a/src/tabwidget.cpp +++ b/src/tabwidget.cpp @@ -295,8 +295,7 @@ void TabWidget::clear() void TabWidget::moveTab(int fromIndex, int toIndex) { - disconnect(this, SIGNAL(currentChanged(int)), - this, SLOT(currentChanged(int))); + disconnect(this, SIGNAL(currentChanged(int)), this, SLOT(currentChanged(int))); QWidget *tabWidget = widget(fromIndex); QIcon icon = tabIcon(fromIndex); @@ -343,20 +342,14 @@ void TabWidget::currentChanged(int index) WebView *oldWebView = this->webView(m_lineEdits->currentIndex()); if (oldWebView) { - disconnect(oldWebView, SIGNAL(statusBarMessage(const QString&)), - this, SIGNAL(showStatusBarMessage(const QString&))); - disconnect(oldWebView->page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)), - this, SIGNAL(linkHovered(const QString&))); - disconnect(oldWebView, SIGNAL(loadProgress(int)), - this, SIGNAL(loadProgress(int))); + disconnect(oldWebView, SIGNAL(statusBarMessage(const QString&)), this, SIGNAL(showStatusBarMessage(const QString&))); + disconnect(oldWebView->page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)), this, SIGNAL(linkHovered(const QString&))); + disconnect(oldWebView, SIGNAL(loadProgress(int)), this, SIGNAL(loadProgress(int))); } - connect(webView, SIGNAL(statusBarMessage(const QString&)), - this, SIGNAL(showStatusBarMessage(const QString&))); - connect(webView->page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)), - this, SIGNAL(linkHovered(const QString&))); - connect(webView, SIGNAL(loadProgress(int)), - this, SIGNAL(loadProgress(int))); + connect(webView, SIGNAL(statusBarMessage(const QString&)), this, SIGNAL(showStatusBarMessage(const QString&))); + connect(webView->page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)), this, SIGNAL(linkHovered(const QString&))); + connect(webView, SIGNAL(loadProgress(int)), this, SIGNAL(loadProgress(int))); for (int i = 0; i < m_actions.count(); ++i) { @@ -367,10 +360,9 @@ void TabWidget::currentChanged(int index) m_lineEdits->setCurrentIndex(index); emit loadProgress(webView->progress()); emit showStatusBarMessage(webView->lastStatusBarText()); - if (webView->url().isEmpty()) - m_lineEdits->currentWidget()->setFocus(); - else - webView->setFocus(); + + // set focus to the current webview + webView->setFocus(); } -- cgit v1.2.1