summaryrefslogtreecommitdiffstats
path: root/src/core/api/qwebenginescript.cpp
diff options
context:
space:
mode:
authorAnu Aliyas <anu.aliyas@qt.io>2024-08-21 11:41:07 +0200
committerAnu Aliyas <anu.aliyas@qt.io>2024-08-24 09:26:51 +0200
commite013c508e99b74866a480a52d6a23aeda0473b4b (patch)
tree1c641e908e0d82ca7aa844a5edc379b47137115a /src/core/api/qwebenginescript.cpp
parent712607ff9ce24779393fa44163705916ebf9b3a7 (diff)
Document sourceUrl() and setSourceUrl() in QWebEngineScript
Added missing documentation for sourceUrl and setSourceUrl in QWebEngineScript. Fixes: QTBUG-128140 Pick-to: 6.7 6.8 Change-Id: Iff77961060a8b3efea42d074ac66c4800afc0fb3 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'src/core/api/qwebenginescript.cpp')
-rw-r--r--src/core/api/qwebenginescript.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/core/api/qwebenginescript.cpp b/src/core/api/qwebenginescript.cpp
index 29b92a396..846b01196 100644
--- a/src/core/api/qwebenginescript.cpp
+++ b/src/core/api/qwebenginescript.cpp
@@ -131,12 +131,26 @@ void QWebEngineScript::setName(const QString &scriptName)
d->setName(scriptName);
}
-
+/*!
+ * Returns the remote source location of the user script (if any).
+ */
QUrl QWebEngineScript::sourceUrl() const
{
return d->sourceUrl();
}
+/*!
+ * Sets the remote source location of the user script to \a url.
+ *
+ * Unlike \l setSourceCode(), this function allows referring to user scripts that
+ * are not already loaded in memory, for instance, when stored on disk.
+ *
+ * Setting this value will change the \l sourceCode of the script.
+ *
+ * \note At present, only file-based sources are supported.
+ *
+ * \sa setSourceCode()
+ */
void QWebEngineScript::setSourceUrl(const QUrl &url)
{
if (url == sourceUrl())