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/api | |
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/api')
-rw-r--r-- | src/webenginewidgets/api/qwebenginepage.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index 5da39e814..67f3d7a76 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -2406,6 +2406,10 @@ void QWebEnginePage::printToPdf(const QString &filePath, const QPageLayout &page The \a resultCallback must take a const reference to a QByteArray as parameter. If printing was successful, this byte array will contain the PDF data, otherwise, the byte array will be empty. + \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. + \since 5.7 */ void QWebEnginePage::printToPdf(const QWebEngineCallback<const QByteArray&> &resultCallback, const QPageLayout &pageLayout) @@ -2441,6 +2445,11 @@ void QWebEnginePage::printToPdf(const QWebEngineCallback<const QByteArray&> &res The \a resultCallback must take a boolean as parameter. If printing was successful, this boolean will have the value \c true, otherwise, its 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. + \since 5.8 */ void QWebEnginePage::print(QPrinter *printer, const QWebEngineCallback<bool> &resultCallback) |