summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/webenginewidgets/demobrowser/browsermainwindow.cpp2
-rw-r--r--src/webengine/api/qquickwebengineview.cpp2
-rw-r--r--src/webengine/api/qquickwebengineview_p.h2
-rw-r--r--src/webengine/doc/src/webengineview.qdoc2
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp4
-rw-r--r--src/webenginewidgets/api/qwebenginepage.h6
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp4
7 files changed, 11 insertions, 11 deletions
diff --git a/examples/webenginewidgets/demobrowser/browsermainwindow.cpp b/examples/webenginewidgets/demobrowser/browsermainwindow.cpp
index e72a2b5fe..0f24de707 100644
--- a/examples/webenginewidgets/demobrowser/browsermainwindow.cpp
+++ b/examples/webenginewidgets/demobrowser/browsermainwindow.cpp
@@ -729,7 +729,7 @@ void BrowserMainWindow::slotFilePrintToPDF()
m_printerOutputFileName = printer.outputFileName();
- currentTab()->page()->printToPdf(printer.pageLayout(), invoke(this, &BrowserMainWindow::slotHandlePdfPrinted));
+ currentTab()->page()->printToPdf(invoke(this, &BrowserMainWindow::slotHandlePdfPrinted), printer.pageLayout());
#endif // QT_NO_PRINTER
}
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 99d6cc746..a3d37f83a 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -1210,7 +1210,7 @@ void QQuickWebEngineView::printToPdf(const QString& filePath, PrintedPageSizeId
d->adapter->printToPDF(pageLayout, filePath);
}
-void QQuickWebEngineView::printToPdf(PrintedPageSizeId pageSizeId, PrintedPageOrientation orientation, const QJSValue &callback)
+void QQuickWebEngineView::printToPdf(const QJSValue &callback, PrintedPageSizeId pageSizeId, PrintedPageOrientation orientation)
{
Q_D(QQuickWebEngineView);
QPageSize layoutSize(static_cast<QPageSize::PageSizeId>(pageSizeId));
diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h
index 7a23e3011..065e7c529 100644
--- a/src/webengine/api/qquickwebengineview_p.h
+++ b/src/webengine/api/qquickwebengineview_p.h
@@ -475,7 +475,7 @@ public Q_SLOTS:
Q_REVISION(2) void setActiveFocusOnPress(bool arg);
Q_REVISION(2) void triggerWebAction(WebAction action);
Q_REVISION(3) void printToPdf(const QString &filePath, PrintedPageSizeId pageSizeId = PrintedPageSizeId::A4, PrintedPageOrientation orientation = PrintedPageOrientation::Portrait);
- Q_REVISION(3) void printToPdf(PrintedPageSizeId pageSizeId = PrintedPageSizeId::A4, PrintedPageOrientation orientation = PrintedPageOrientation::Portrait, const QJSValue &callback = QJSValue());
+ Q_REVISION(3) void printToPdf(const QJSValue &callback, PrintedPageSizeId pageSizeId = PrintedPageSizeId::A4, PrintedPageOrientation orientation = PrintedPageOrientation::Portrait);
#if !defined(QT_NO_SPELLCHECK)
Q_REVISION(3) void replaceMisspelledWord(const QString &replacement);
diff --git a/src/webengine/doc/src/webengineview.qdoc b/src/webengine/doc/src/webengineview.qdoc
index 7b6c66e1e..3bebb8cea 100644
--- a/src/webengine/doc/src/webengineview.qdoc
+++ b/src/webengine/doc/src/webengineview.qdoc
@@ -1075,7 +1075,7 @@
*/
/*!
- \qmlmethod void WebEngineView::printToPdf(PrintedPageSizeId pageSizeId, PrintedPageOrientation orientation, variant resultCallback)
+ \qmlmethod void WebEngineView::printToPdf(variant resultCallback, PrintedPageSizeId pageSizeId, PrintedPageOrientation orientation)
\since QtWebEngine 1.3
Prints the WebEngineView's current content to a PDF document and returns it in a byte array. The document's size will be determined
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index 0a27a3938..1d7660711 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -1722,7 +1722,7 @@ void QWebEnginePage::printToPdf(const QString &filePath, const QPageLayout &page
/*!
- \fn void QWebEnginePage::printToPdf(const QPageLayout &pageLayout, FunctorOrLambda resultCallback)
+ \fn void QWebEnginePage::printToPdf(FunctorOrLambda resultCallback, const QPageLayout &pageLayout)
Renders the current content of the page into a PDF document and returns a byte array containing the PDF data
as parameter to \a resultCallback.
The page size and orientation of the produced PDF document are taken from the values specified in \a pageLayout.
@@ -1732,7 +1732,7 @@ void QWebEnginePage::printToPdf(const QString &filePath, const QPageLayout &page
\since 5.7
*/
-void QWebEnginePage::printToPdf(const QPageLayout &pageLayout, const QWebEngineCallback<const QByteArray&> &resultCallback)
+void QWebEnginePage::printToPdf(const QWebEngineCallback<const QByteArray&> &resultCallback, const QPageLayout &pageLayout)
{
Q_D(QWebEnginePage);
quint64 requestId = d->adapter->printToPDFCallbackResult(pageLayout);
diff --git a/src/webenginewidgets/api/qwebenginepage.h b/src/webenginewidgets/api/qwebenginepage.h
index bc6d101a1..3c3a28d80 100644
--- a/src/webenginewidgets/api/qwebenginepage.h
+++ b/src/webenginewidgets/api/qwebenginepage.h
@@ -272,11 +272,11 @@ public:
void setAudioMuted(bool muted);
bool recentlyAudible() const;
- void printToPdf(const QString &filePath, const QPageLayout &layout);
+ void printToPdf(const QString &filePath, const QPageLayout &layout = QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF()));
#ifdef Q_QDOC
- void printToPdf(const QPageLayout &layout, FunctorOrLambda resultCallback);
+ void printToPdf(FunctorOrLambda resultCallback, const QPageLayout &layout = QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF()));
#else
- void printToPdf(const QPageLayout &layout, const QWebEngineCallback<const QByteArray&> &resultCallback);
+ void printToPdf(const QWebEngineCallback<const QByteArray&> &resultCallback, const QPageLayout &layout = QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF()));
#endif
const QWebEngineContextMenuData &contextMenuData() const;
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 95e6f5374..2740b698c 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -5006,11 +5006,11 @@ void tst_QWebEnginePage::printToPdf()
QTRY_VERIFY(!QFile::exists(path));
CallbackSpy<QByteArray> successfulSpy;
- page.printToPdf(layout, successfulSpy.ref());
+ page.printToPdf(successfulSpy.ref(), layout);
QVERIFY(successfulSpy.waitForResult().length() > 0);
CallbackSpy<QByteArray> failedInvalidLayoutSpy;
- page.printToPdf(QPageLayout(), failedInvalidLayoutSpy.ref());
+ page.printToPdf(failedInvalidLayoutSpy.ref(), QPageLayout());
QCOMPARE(failedInvalidLayoutSpy.waitForResult().length(), 0);
}