From 085c2c529473bbe9dd7c8c5698a45053520cc423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Tue, 20 Jun 2017 15:36:43 +0200 Subject: 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 Reviewed-by: Rolf Eike Beer --- src/webenginewidgets/api/qwebenginepage.cpp | 10 ++-------- src/webenginewidgets/api/qwebenginepage.h | 8 -------- 2 files changed, 2 insertions(+), 16 deletions(-) (limited to 'src') 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 #include #include -#if defined(QT_PRINTSUPPORT_LIB) -#ifndef QT_NO_PRINTER +#ifdef ENABLE_PRINTING #include -#endif //QT_NO_PRINTER -#endif //QT_PRINTSUPPORT_LIB +#endif #include #include #include @@ -2051,8 +2049,6 @@ void QWebEnginePage::printToPdf(const QWebEngineCallback &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 &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 &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 &resultCallback); #endif // QDOC -#endif // QT_NO_PRINTER -#endif // QT_PRINTSUPPORT_LIB const QWebEngineContextMenuData &contextMenuData() const; -- cgit v1.2.3