summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2014-05-15 05:45:47 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-15 18:41:20 +0200
commitfc6f378dd73f0bb6cff8f6d7400bfaf572f7e341 (patch)
treefe22c3bf9963c9314dc566a355772828c259a959
parent5c99742a0e66c5bdae719f6c8ccba80cf7cc1118 (diff)
Add linkHovered support for Widgets API
Drop hovered title and link text parameters, as we did in the Quick API. Change-Id: Ia1a38e0d728afbcbb6858a890486772da74aa813 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
-rw-r--r--examples/webenginewidgets/browser/tabwidget.cpp8
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp6
-rw-r--r--src/webenginewidgets/api/qwebenginepage.h1
-rw-r--r--src/webenginewidgets/api/qwebenginepage_p.h2
4 files changed, 10 insertions, 7 deletions
diff --git a/examples/webenginewidgets/browser/tabwidget.cpp b/examples/webenginewidgets/browser/tabwidget.cpp
index af18b5a3..efc7c438 100644
--- a/examples/webenginewidgets/browser/tabwidget.cpp
+++ b/examples/webenginewidgets/browser/tabwidget.cpp
@@ -310,10 +310,8 @@ void TabWidget::currentChanged(int index)
disconnect(oldWebView, SIGNAL(statusBarMessage(QString)),
this, SIGNAL(showStatusBarMessage(QString)));
#endif
-#if defined(QWEBENGINEVIEW_LINKHOVERED)
- disconnect(oldWebView->page(), SIGNAL(linkHovered(QString,QString,QString)),
+ disconnect(oldWebView->page(), SIGNAL(linkHovered(QString)),
this, SIGNAL(linkHovered(QString)));
-#endif
disconnect(oldWebView, SIGNAL(loadProgress(int)),
this, SIGNAL(loadProgress(int)));
}
@@ -322,10 +320,8 @@ void TabWidget::currentChanged(int index)
connect(webView, SIGNAL(statusBarMessage(QString)),
this, SIGNAL(showStatusBarMessage(QString)));
#endif
-#if defined(QWEBENGINEVIEW_LINKHOVERED)
- connect(webView->page(), SIGNAL(linkHovered(QString,QString,QString)),
+ connect(webView->page(), SIGNAL(linkHovered(QString)),
this, SIGNAL(linkHovered(QString)));
-#endif
connect(webView, SIGNAL(loadProgress(int)),
this, SIGNAL(loadProgress(int)));
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index 4bd97c07..bbdcb25d 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -205,6 +205,12 @@ void QWebEnginePagePrivate::loadProgressChanged(int progress)
Q_EMIT q->loadProgress(progress);
}
+void QWebEnginePagePrivate::didUpdateTargetURL(const QUrl &hoveredUrl)
+{
+ Q_Q(QWebEnginePage);
+ Q_EMIT q->linkHovered(hoveredUrl.toString());
+}
+
void QWebEnginePagePrivate::selectionChanged()
{
Q_Q(QWebEnginePage);
diff --git a/src/webenginewidgets/api/qwebenginepage.h b/src/webenginewidgets/api/qwebenginepage.h
index be5e4c52..eaeae9a7 100644
--- a/src/webenginewidgets/api/qwebenginepage.h
+++ b/src/webenginewidgets/api/qwebenginepage.h
@@ -183,6 +183,7 @@ Q_SIGNALS:
void loadProgress(int progress);
void loadFinished(bool ok);
+ void linkHovered(const QString &url);
void selectionChanged();
void geometryChangeRequested(const QRect& geom);
void windowCloseRequested();
diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h
index d94b47fd..db0da05e 100644
--- a/src/webenginewidgets/api/qwebenginepage_p.h
+++ b/src/webenginewidgets/api/qwebenginepage_p.h
@@ -114,7 +114,7 @@ public:
virtual void urlChanged(const QUrl&) Q_DECL_OVERRIDE;
virtual void iconChanged(const QUrl&) Q_DECL_OVERRIDE;
virtual void loadProgressChanged(int progress) Q_DECL_OVERRIDE;
- virtual void didUpdateTargetURL(const QUrl&) Q_DECL_OVERRIDE { };
+ virtual void didUpdateTargetURL(const QUrl&) Q_DECL_OVERRIDE;
virtual void selectionChanged() Q_DECL_OVERRIDE;
virtual QRectF viewportRect() const Q_DECL_OVERRIDE;
virtual QPoint mapToGlobal(const QPoint &posInView) const Q_DECL_OVERRIDE;