From f8ac9f0eb1745648750493cfbb16eed0d859b212 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Mon, 11 Jan 2016 10:37:31 +0100 Subject: Doc: link capturing methods Task-number: QTBUG-48435 Change-Id: If7117ecb11a0f06df1204dc91757a29c5444e189 Reviewed-by: Leena Miettinen --- src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc | 7 +++++++ src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc b/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc index ca1309718..065e5a18b 100644 --- a/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc +++ b/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc @@ -279,5 +279,12 @@ \li In the latest HTML standard, any document element can be made editable through the \c contentEditable attribute. So \c runJavaScript is all that is needed: \c{page->runJavascript("document.documentElement.contentEditable = true")} + \row + \li QWebPage::setLinkDelegationPolicy + \li There is no way to connect a signal to run C++ code when a link is clicked. However, + link clicks can be delegated to the Qt application instead of having the HTML handler + engine process them by overloading the QWebEnginePage::acceptNavigationRequest() + function. This is necessary when an HTML document is used as part of the user interface, + and not to display external data, for example, when displaying a list of results. \endtable */ diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc index a6f015434..22eacfda9 100644 --- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc @@ -275,8 +275,17 @@ the specified navigation type \a type. \a isMainFrame indicates whether the request corresponds to the main frame or a sub frame. If the function returns \c true, the navigation request is accepted and \c url is loaded. The default implementation accepts all navigation requests. -*/ + This function is called for absolute URLs that are prefixed with \c {http://} or \c {https://} + and for unrecognized schemes, such as \c {mailto:}, which will be handled by QDesktopServices + if accepted. To have this function called also upon receiving navigation requests to local URLs, + prefix the URLs with \c {http://}. + + Navigation requests can be delegated to the Qt application instead of having the HTML handler + engine process them by overloading this function. This is necessary when an HTML document is + used as part of the user interface, and not to display external data, for example, when + displaying a list of results. +*/ /*! \fn void QWebEnginePage::javaScriptAlert(const QUrl &securityOrigin, const QString& msg) -- cgit v1.2.3