summaryrefslogtreecommitdiffstats
path: root/src/core/api/qwebengineframe.h
diff options
context:
space:
mode:
authorMoss Heim <moss.heim@qt.io>2024-05-27 17:08:34 +0200
committerMoss Heim <moss.heim@qt.io>2024-06-03 07:52:31 +0000
commitece3b065828bc6ca09dd2ad8654b48cdaddf1178 (patch)
tree1e0673a15f07bf80e3bd3f66ad97d57fe8306f57 /src/core/api/qwebengineframe.h
parent8fa02a184ea53989425865c8e98c399faceea66e (diff)
Add QWebEngineFrame::printToPdf
Provide API calls to (1) save to file (QString) and (2) get the bytes in a callback. Pick-to: 6.8 Change-Id: I0ff44a25328b99080491b8c3b36a7b632c065131 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/api/qwebengineframe.h')
-rw-r--r--src/core/api/qwebengineframe.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/api/qwebengineframe.h b/src/core/api/qwebengineframe.h
index 3042fbae0..34b72e08e 100644
--- a/src/core/api/qwebengineframe.h
+++ b/src/core/api/qwebengineframe.h
@@ -49,6 +49,10 @@ public:
Q_INVOKABLE void runJavaScript(const QString &script, quint32 worldId,
const QJSValue &callback);
+ Q_INVOKABLE void printToPdf(const QString &filePath);
+ void printToPdf(const std::function<void(const QByteArray &)> &callback);
+ Q_INVOKABLE void printToPdf(const QJSValue &callback);
+
friend inline bool comparesEqual(const QWebEngineFrame &lhs,
const QWebEngineFrame &rhs) noexcept
{