summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/doc
diff options
context:
space:
mode:
authorJüri Valdmann <juri.valdmann@qt.io>2020-07-22 11:18:26 +0200
committerJüri Valdmann <juri.valdmann@qt.io>2020-07-22 12:21:48 +0200
commit293397cc577eb8e0805e0ef68f960dbb4574cf24 (patch)
tree93bfc3bc5f5cdca33296ffbc3108bcae5dab69a5 /src/webenginewidgets/doc
parent69be445c4412c886c6c9619fe377265a958844b8 (diff)
Fix incorrect doc for acceptNavigationRequest and add test
The function is called for all navigation requests. The original bug report was most likely due to the use relative links on a page without a base url, which indeed results in no call to acceptNavigationRequest being made. But this has nothing to do with local vs remote URLs, it's rather that relative links, which are relative to nothing, are not valid links and there thus cannot be any navigation request either. Task-number: QTBUG-48435 Change-Id: I08bd0c86d67bf1dd1d7662468321777254a7db0b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/webenginewidgets/doc')
-rw-r--r--src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
index 9d5c41713..789d9794e 100644
--- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
@@ -376,11 +376,6 @@
to the main frame or a child 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
@@ -391,6 +386,10 @@
signal that returns \c false is to be expected even after delegating the
request.
+ \note When using setHtml or setContent with relative links, make
+ sure to specify a base url, otherwise the links will be considered
+ invalid and no navigation requests will be emitted.
+
The \l{QWebEngineUrlRequestInterceptor} class offers further options for intercepting and
manipulating requests.
*/