diff options
author | Michael Bruning <michael.bruning@qt.io> | 2016-08-10 17:22:05 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2016-08-24 16:19:28 +0000 |
commit | af2535018b1553e351198f3d9c21538de1c328a1 (patch) | |
tree | dc66a94a925477f60aa155b0ba979fadfc560a80 /src/core/web_contents_adapter.h | |
parent | eeac120ec135e2ab0bd02f399afb50b684d00298 (diff) |
Add widgets API for printing on a QPrinter
Renders the content to a PDF document and then renders this on a
QPrinter-backed QPainter using the PDFium library.
PDFium bitmap to QImage conversion based on work by Paulo Pinheiro
<paulvap.os@gmail.com>.
[ChangeLog][QtWebEngineWidgets][Printing] Enables printing QWebPage
content on a QPrinter. Currently does not support previewing the
document. Widgets only for the moment.
Change-Id: I9a5264433093379aee90f5e4f69bf2aee8814f2b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_contents_adapter.h')
-rw-r--r-- | src/core/web_contents_adapter.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h index 08f68e76b..7a109770e 100644 --- a/src/core/web_contents_adapter.h +++ b/src/core/web_contents_adapter.h @@ -58,6 +58,9 @@ class QAccessibleInterface; class QDragEnterEvent; class QDragMoveEvent; class QPageLayout; +#if !defined(QT_NO_WIDGETS) && !defined(QT_NO_PRINTER) +class QPrinter; +#endif // QT_NO_PRINTER class QString; class QWebChannel; QT_END_NAMESPACE @@ -174,6 +177,10 @@ public: void printToPDF(const QPageLayout&, const QString&); quint64 printToPDFCallbackResult(const QPageLayout &); +#if !defined(QT_NO_WIDGETS) && !defined(QT_NO_PRINTER) + quint64 printOnPrinterCallbackResult(QPrinter *printer); +#endif + // meant to be used within WebEngineCore only content::WebContents *webContents() const; void replaceMisspelling(const QString &word); |