summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/doc
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2015-09-10 16:08:21 +0200
committerKai Koehne <kai.koehne@theqtcompany.com>2015-10-08 10:31:40 +0000
commit6df94b3cfd7eab7222542237a219144615bd434b (patch)
treecab61674064270d2eccc00c14a19246be2ec43ed /src/webenginewidgets/doc
parenta45f6fc3e1016a223a4b235cc61b033f8665c853 (diff)
Improve runJavaScript documentation
Mention that the script will run in the same JavaScript world as scripts that are part of the page. Also link to new scripts API. Change-Id: I4dd80fdd84644b1fa4ce6c63ab07c1dbba855389 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/webenginewidgets/doc')
-rw-r--r--src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
index 794cb56d2..173611165 100644
--- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
@@ -596,16 +596,27 @@
/*!
\fn void QWebEnginePage::runJavaScript(const QString& scriptSource)
- Runs the JavaScript code contained in \a scriptSource.
+ \overload runJavaScript()
+
+ This convenience function runs the JavaScript code contained in \a scriptSource.
*/
/*!
\fn void QWebEnginePage::runJavaScript(const QString& scriptSource, FunctorOrLambda resultCallback)
+
Runs the JavaScript code contained in \a scriptSource.
+ The script will run in the same \e world as other scripts that are part of the loaded site.
+
When the script has been executed, \a resultCallback is called with the result of the last executed statement.
+ \a resultCallback can be any of a function pointer, a functor or a lambda, and it is expected to take a
+ QVariant parameter. For example:
+
+ \code
+ page.runJavaScript("document.title", [](const QVariant &v) { qDebug() << v.toString(); });
+ \endcode
- \note \a resultCallback can be any of a function pointer, a functor or a lambda, and it is expected to take a QVariant parameter.
+ See scripts() for an alternative API to inject scripts.
*/
/*!