diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2017-06-20 15:36:43 +0200 |
---|---|---|
committer | Rolf Eike Beer <eb@emlix.com> | 2017-06-26 12:37:21 +0000 |
commit | 085c2c529473bbe9dd7c8c5698a45053520cc423 (patch) | |
tree | 2830cfdb0750d303c41f411dd6a8ea3eed0fd6e9 /src/webenginewidgets | |
parent | f8d91f930057154633d91cd513ce313d4c400090 (diff) |
Always compile QWebEnginePage::print
- Remove two out of five layers of ifdefs around and inside this method.
- Now always compiled but will yield an error if printing is disabled.
- Remove printing-related ifdefs from demobrowser.
Task-number: QTBUG-61510
Change-Id: I79781189d3d3fb62db0a2216b2b989e3fa1d1f86
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Rolf Eike Beer <eb@emlix.com>
Diffstat (limited to 'src/webenginewidgets')
-rw-r--r-- | src/webenginewidgets/api/qwebenginepage.cpp | 10 | ||||
-rw-r--r-- | src/webenginewidgets/api/qwebenginepage.h | 8 |
2 files changed, 2 insertions, 16 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index 2cdb0116d..6042b9fdc 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -80,11 +80,9 @@ #include <QMenu> #include <QMessageBox> #include <QMimeData> -#if defined(QT_PRINTSUPPORT_LIB) -#ifndef QT_NO_PRINTER +#ifdef ENABLE_PRINTING #include <QPrinter> -#endif //QT_NO_PRINTER -#endif //QT_PRINTSUPPORT_LIB +#endif #include <QStandardPaths> #include <QStyle> #include <QTimer> @@ -2051,8 +2049,6 @@ void QWebEnginePage::printToPdf(const QWebEngineCallback<const QByteArray&> &res #endif // if defined(ENABLE_PDF) } -#if defined(QT_PRINTSUPPORT_LIB) -#ifndef QT_NO_PRINTER /*! \fn void QWebEnginePage::print(QPrinter *printer, FunctorOrLambda resultCallback) Renders the current content of the page into a temporary PDF document, then prints it using \a printer. @@ -2089,8 +2085,6 @@ void QWebEnginePage::print(QPrinter *printer, const QWebEngineCallback<bool> &re d->m_callbacks.invokeDirectly(resultCallback, false); #endif // if defined(ENABLE_PDF) } -#endif // if defined(QT_NO_PRINTER) -#endif // if defined(QT_PRINTSUPPORT_LIB) /*! \since 5.7 diff --git a/src/webenginewidgets/api/qwebenginepage.h b/src/webenginewidgets/api/qwebenginepage.h index c7d5a19e3..5619639c7 100644 --- a/src/webenginewidgets/api/qwebenginepage.h +++ b/src/webenginewidgets/api/qwebenginepage.h @@ -55,11 +55,7 @@ QT_BEGIN_NAMESPACE class QMenu; -#if defined(QT_PRINTSUPPORT_LIB) -#ifndef QT_NO_PRINTER class QPrinter; -#endif // QT_NO_PRINTER -#endif // QT_PRINTSUPPORT_LIB class QWebChannel; class QWebEngineContextMenuData; @@ -294,15 +290,11 @@ public: void printToPdf(const QWebEngineCallback<const QByteArray&> &resultCallback, const QPageLayout &layout = QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF())); #endif -#if defined(QT_PRINTSUPPORT_LIB) -#ifndef QT_NO_PRINTER #ifdef Q_QDOC void print(QPrinter *printer, FunctorOrLambda resultCallback); #else void print(QPrinter *printer, const QWebEngineCallback<bool> &resultCallback); #endif // QDOC -#endif // QT_NO_PRINTER -#endif // QT_PRINTSUPPORT_LIB const QWebEngineContextMenuData &contextMenuData() const; |