diff options
author | Tamas Zakor <ztamas@inf.u-szeged.hu> | 2019-01-25 14:41:52 +0100 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2019-02-08 12:03:49 +0000 |
commit | b3872ab2bb94b70e3f43cdf4217d959b95815d26 (patch) | |
tree | 2f7592a4eca8231cf6c0b7c73c95f78e7e4f2556 /src/webenginewidgets/doc/src | |
parent | 68733d4fb913255fba47b1f7190cf85ad57e6541 (diff) |
Doc: Extend documentation of callbacks
Warn about callbacks on QWebEnginePage destruction.
Task-number: QTBUG-72816
Change-Id: I8dbc297a8f364bc237b0672a63325af8da197e01
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/webenginewidgets/doc/src')
-rw-r--r-- | src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc | 16 | ||||
-rw-r--r-- | src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc | 4 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc index d012c678c..035b45a6d 100644 --- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc @@ -485,6 +485,10 @@ The \a resultCallback must take a boolean parameter. It will be called with a value of \c true if the \a subString was found; otherwise the callback value will be \c false. + \warning We guarantee that the callback (\a resultCallback) is always called, but it might be done + during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid + value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it. + For example: \snippet qtwebengine_qwebenginepage_snippet.cpp 0 */ @@ -613,6 +617,10 @@ \note \a resultCallback can be any of a function pointer, a functor or a lambda, and it is expected to take a QString parameter. + \warning We guarantee that the callback (\a resultCallback) is always called, but it might be done + during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid + value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it. + \sa setHtml(), toPlainText() */ @@ -624,6 +632,10 @@ \note \a resultCallback can be any of a function pointer, a functor or a lambda, and it is expected to take a QString parameter. + \warning We guarantee that the callback (\a resultCallback) is always called, but it might be done + during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid + value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it. + \sa toHtml() */ @@ -743,6 +755,10 @@ \warning Do not execute lengthy routines in the callback function, because it might block the rendering of the web engine page. + \warning We guarantee that the callback (\a resultCallback) is always called, but it might be done + during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid + value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it. + See scripts() for an alternative API to inject scripts. \sa QWebEngineScript::ScriptWorldId diff --git a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc index 09346a446..501959ab9 100644 --- a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc @@ -252,6 +252,10 @@ \a resultCallback must take a boolean parameter. It will be called with a value of \c true if \a subString was found; otherwise the callback value will be \c false. + \warning We guarantee that the callback (\a resultCallback) is always called, but it might be done + during page destruction. When QWebEnginePage is deleted, the callback is triggered with an invalid + value and it is not safe to use the corresponding QWebEnginePage or QWebEngineView instance inside it. + \sa selectedText(), selectionChanged() */ |