diff options
author | Szabolcs David <davidsz@inf.u-szeged.hu> | 2022-12-12 17:54:09 +0100 |
---|---|---|
committer | Szabolcs David <davidsz@inf.u-szeged.hu> | 2023-04-05 19:08:06 +0200 |
commit | c3ed0e176ccda503c968626010ca36f1f3961fce (patch) | |
tree | 846c865d38066a469b43893ced0931b612b5c2bd /src/webenginewidgets/api | |
parent | fe9d72d931f40eafca97c1012c03e24561c973ff (diff) |
Better handling of interrupted PDF printing
- Document the fact Stop WebAction can interrupt the in-progress PDF
generation.
- Update PrintViewManagerQt::PrintPreviewDone(): Normally
IsPrintRenderFrameConnected() implies IsRenderFrameLive(), but we have
to check both to avoid crash when render process exits. (Like Chrome
does.)
- Update PrintViewManagerQt::RequestPrintPreview(): Handle that case when
print preview params were sent between processes at the beginning, but it
was interrupted before RequestPrintPreview() could start PDF generation.
- Add a simple auto test to catch crashes
Pick-to: 6.5
Task-number: QTBUG-108154
Change-Id: I8a4f9cc97ddcf9a165d66a5981d93a023858fbc1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/webenginewidgets/api')
-rw-r--r-- | src/webenginewidgets/api/qwebengineview.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp index fd74268f2..35fb98138 100644 --- a/src/webenginewidgets/api/qwebengineview.cpp +++ b/src/webenginewidgets/api/qwebengineview.cpp @@ -1408,6 +1408,9 @@ void QWebEngineView::printToPdf(const std::function<void(const QByteArray&)> &re \note Printing runs on the browser process, which is by default not sandboxed. + \note The data generation step of printing can be interrupted for a short period of time using + the \l QWebEnginePage::Stop web action. + \note This function rasterizes the result when rendering onto \a printer. Please consider raising the default resolution of \a printer to at least 300 DPI or using printToPdf() to produce PDF file output more effectively. |