diff options
author | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-11-05 13:34:14 +0100 |
---|---|---|
committer | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-11-05 15:01:24 +0000 |
commit | 40ef43e0d69c4a86c9430b7f264d2cde6340ee0f (patch) | |
tree | 074cff0a53b494aa2a77c0aa3869b2cd2a06d59f /src/webenginewidgets/api | |
parent | 09018b99dce7a8ed43b0842055e8775d5021cf04 (diff) |
Improve documentation for QWebEngineScript
Change-Id: I9274a3cacaa04529152a5d827c47cf6fc831df19
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/webenginewidgets/api')
4 files changed, 18 insertions, 4 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index acce76910..c0323a87e 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -1210,8 +1210,12 @@ void QWebEnginePage::runJavaScript(const QString& scriptSource, const QWebEngine } /*! - Returns the script collection used by this page. - \sa QWebEngineScriptCollection + Returns the collection of scripts that are injected into the page. + + In addition, a page might also execute scripts + added through QWebEngineProfile::scripts(). + + \sa QWebEngineScriptCollection, QWebEngineScript */ QWebEngineScriptCollection &QWebEnginePage::scripts() diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp index 07deeeefc..5fbc4d63c 100644 --- a/src/webenginewidgets/api/qwebengineprofile.cpp +++ b/src/webenginewidgets/api/qwebengineprofile.cpp @@ -490,8 +490,10 @@ bool QWebEngineProfile::visitedLinksContainsUrl(const QUrl &url) const } /*! - Returns the script collection used by this profile. - \sa QWebEngineScriptCollection + Returns the collection of scripts that are injected into all pages that share + this profile. + + \sa QWebEngineScriptCollection, QWebEngineScript, QWebEnginePage::scripts() */ QWebEngineScriptCollection *QWebEngineProfile::scripts() const { diff --git a/src/webenginewidgets/api/qwebenginescript.cpp b/src/webenginewidgets/api/qwebenginescript.cpp index 1bd56604d..058f58475 100644 --- a/src/webenginewidgets/api/qwebenginescript.cpp +++ b/src/webenginewidgets/api/qwebenginescript.cpp @@ -58,6 +58,9 @@ using QtWebEngineCore::UserScript; not accessible from a different one. ScriptWorldId provides some predefined IDs for this purpose. + Use QWebEnginePage::scripts() and QWebEngineProfile::scripts() to access + the collection of scripts associated with a single page or a + number of pages sharing the same profile. */ /*! \enum QWebEngineScript::InjectionPoint diff --git a/src/webenginewidgets/api/qwebenginescriptcollection.cpp b/src/webenginewidgets/api/qwebenginescriptcollection.cpp index 80a7f9b6e..9967cde85 100644 --- a/src/webenginewidgets/api/qwebenginescriptcollection.cpp +++ b/src/webenginewidgets/api/qwebenginescriptcollection.cpp @@ -47,6 +47,11 @@ using QtWebEngineCore::UserScript; \since 5.5 \brief The QWebEngineScriptCollection class represents a collection of user scripts. + QWebEngineScriptCollection manages a set of user scripts. + + Use QWebEnginePage::scripts() and QWebEngineProfile::scripts() to access + the collection of scripts associated with a single page or a + number of pages sharing the same profile. */ /*! |