summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-06-08 13:11:55 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-06-22 14:23:30 +0000
commita693cae520455ece9bf860ab2804f03d465d51af (patch)
tree530c06f750c0554af3e46f368be96f7fe80cadb2 /src/core/web_contents_adapter.cpp
parent3752a3cbcd0cc0742a5b955e925df18395afdb75 (diff)
Add QPageRanges to PDF printing
Task-number: QTBUG-73497 Change-Id: I0a66c4f1767c54b0bcc9f9a3b61e29c43ec20177 Reviewed-by: Michal Klocek <michal.klocek@qt.io> (cherry picked from commit 0887e880ced988704559505816b520972e6876c6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r--src/core/web_contents_adapter.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index dd506f1e1..70b5e42aa 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -1326,7 +1326,7 @@ void WebContentsAdapter::wasHidden()
m_webContents->WasHidden();
}
-void WebContentsAdapter::printToPDF(const QPageLayout &pageLayout, const QString &filePath)
+void WebContentsAdapter::printToPDF(const QPageLayout &pageLayout, const QPageRanges &pageRanges, const QString &filePath)
{
#if QT_CONFIG(webengine_printing_and_pdf)
CHECK_INITIALIZED();
@@ -1334,13 +1334,15 @@ void WebContentsAdapter::printToPDF(const QPageLayout &pageLayout, const QString
m_adapterClient,
filePath);
PrintViewManagerQt::FromWebContents(m_webContents.get())->PrintToPDFFileWithCallback(pageLayout,
- true,
- filePath,
- callback);
+ pageRanges,
+ true,
+ filePath,
+ callback);
#endif // QT_CONFIG(webengine_printing_and_pdf)
}
quint64 WebContentsAdapter::printToPDFCallbackResult(const QPageLayout &pageLayout,
+ const QPageRanges &pageRanges,
bool colorMode,
bool useCustomMargins)
{
@@ -1350,9 +1352,10 @@ quint64 WebContentsAdapter::printToPDFCallbackResult(const QPageLayout &pageLayo
m_adapterClient,
m_nextRequestId);
PrintViewManagerQt::FromWebContents(m_webContents.get())->PrintToPDFWithCallback(pageLayout,
- colorMode,
- useCustomMargins,
- callback);
+ pageRanges,
+ colorMode,
+ useCustomMargins,
+ callback);
return m_nextRequestId++;
#else
Q_UNUSED(pageLayout);