summaryrefslogtreecommitdiffstats
path: root/src/printsupport/kernel
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-06-07 12:05:33 +0200
committerLiang Qi <liang.qi@qt.io>2017-06-07 14:02:43 +0200
commit7cbee5629604aa49c618829c8e3e55fc64e94df7 (patch)
treed12041105160c1cb21226b365edb9653d87b5853 /src/printsupport/kernel
parente400b7e326c554ccd819448866265953d2a0f24d (diff)
parent5f0ce2333f7e11a3ffb5d16a27cd9303efa712d5 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/widgets/widgets/qmenu.cpp Change-Id: I6d3baf56eb24501cddb129a3cb6b958ccc25a308
Diffstat (limited to 'src/printsupport/kernel')
-rw-r--r--src/printsupport/kernel/kernel.pri7
-rw-r--r--src/printsupport/kernel/qcups.cpp4
-rw-r--r--src/printsupport/kernel/qcups_p.h4
-rw-r--r--src/printsupport/kernel/qpaintengine_preview.cpp3
-rw-r--r--src/printsupport/kernel/qpaintengine_preview_p.h4
-rw-r--r--src/printsupport/kernel/qplatformprintdevice.cpp2
-rw-r--r--src/printsupport/kernel/qprint_p.h4
-rw-r--r--src/printsupport/kernel/qprinter.cpp8
-rw-r--r--src/printsupport/kernel/qprinter_p.h6
9 files changed, 19 insertions, 23 deletions
diff --git a/src/printsupport/kernel/kernel.pri b/src/printsupport/kernel/kernel.pri
index 90eab4a634..ea7b4b9780 100644
--- a/src/printsupport/kernel/kernel.pri
+++ b/src/printsupport/kernel/kernel.pri
@@ -1,6 +1,5 @@
HEADERS += \
$$PWD/qpaintengine_alpha_p.h \
- $$PWD/qpaintengine_preview_p.h \
$$PWD/qprint_p.h \
$$PWD/qprintdevice_p.h \
$$PWD/qprintengine.h \
@@ -16,7 +15,6 @@ HEADERS += \
SOURCES += \
$$PWD/qpaintengine_alpha.cpp \
- $$PWD/qpaintengine_preview.cpp \
$$PWD/qprintdevice.cpp \
$$PWD/qprintengine_pdf.cpp \
$$PWD/qprinter.cpp \
@@ -25,6 +23,11 @@ SOURCES += \
$$PWD/qplatformprintplugin.cpp \
$$PWD/qplatformprintersupport.cpp
+qtConfig(printpreviewwidget) {
+ HEADERS += $$PWD/qpaintengine_preview_p.h
+ SOURCES += $$PWD/qpaintengine_preview.cpp
+}
+
win32 {
HEADERS += \
$$PWD/qprintengine_win_p.h
diff --git a/src/printsupport/kernel/qcups.cpp b/src/printsupport/kernel/qcups.cpp
index 4bd5c1441a..1c9d522c1c 100644
--- a/src/printsupport/kernel/qcups.cpp
+++ b/src/printsupport/kernel/qcups.cpp
@@ -41,8 +41,6 @@
#include "qprintengine.h"
-#ifndef QT_NO_CUPS
-
QT_BEGIN_NAMESPACE
QStringList QCUPSSupport::cupsOptionsList(QPrinter *printer)
@@ -205,5 +203,3 @@ void QCUPSSupport::setPageRange(QPrinter *printer, int pageFrom, int pageTo)
}
QT_END_NAMESPACE
-
-#endif // QT_NO_CUPS
diff --git a/src/printsupport/kernel/qcups_p.h b/src/printsupport/kernel/qcups_p.h
index 139b18c509..780115e350 100644
--- a/src/printsupport/kernel/qcups_p.h
+++ b/src/printsupport/kernel/qcups_p.h
@@ -57,7 +57,7 @@
#include "QtPrintSupport/qprinter.h"
#include "QtCore/qdatetime.h"
-#ifndef QT_NO_CUPS
+QT_REQUIRE_CONFIG(cups);
QT_BEGIN_NAMESPACE
@@ -150,6 +150,4 @@ Q_DECLARE_METATYPE(QCUPSSupport::PageSet)
Q_DECLARE_METATYPE(QCUPSSupport::PagesPerSheetLayout)
Q_DECLARE_METATYPE(QCUPSSupport::PagesPerSheet)
-#endif // QT_NO_CUPS
-
#endif
diff --git a/src/printsupport/kernel/qpaintengine_preview.cpp b/src/printsupport/kernel/qpaintengine_preview.cpp
index b5d40fd430..4c00333097 100644
--- a/src/printsupport/kernel/qpaintengine_preview.cpp
+++ b/src/printsupport/kernel/qpaintengine_preview.cpp
@@ -46,7 +46,6 @@
#include <QtGui/qpainter.h>
#include <QtGui/qpicture.h>
-#ifndef QT_NO_PRINTPREVIEWWIDGET
QT_BEGIN_NAMESPACE
class QPreviewPaintEnginePrivate : public QPaintEnginePrivate
@@ -218,5 +217,3 @@ QPrinter::PrinterState QPreviewPaintEngine::printerState() const
}
QT_END_NAMESPACE
-
-#endif
diff --git a/src/printsupport/kernel/qpaintengine_preview_p.h b/src/printsupport/kernel/qpaintengine_preview_p.h
index 31b3142cb6..9203e40235 100644
--- a/src/printsupport/kernel/qpaintengine_preview_p.h
+++ b/src/printsupport/kernel/qpaintengine_preview_p.h
@@ -56,7 +56,7 @@
#include <QtGui/qpaintengine.h>
#include <QtPrintSupport/qprintengine.h>
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+QT_REQUIRE_CONFIG(printpreviewwidget);
QT_BEGIN_NAMESPACE
@@ -100,6 +100,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_PRINTPREVIEWWIDGET
-
#endif
diff --git a/src/printsupport/kernel/qplatformprintdevice.cpp b/src/printsupport/kernel/qplatformprintdevice.cpp
index cbb67aefdc..e2d4a08de3 100644
--- a/src/printsupport/kernel/qplatformprintdevice.cpp
+++ b/src/printsupport/kernel/qplatformprintdevice.cpp
@@ -40,7 +40,9 @@
#include "qplatformprintdevice.h"
#include "qprintdevice_p.h"
+#if QT_CONFIG(printdialog)
#include "qprintdialog.h"
+#endif
#include <QtGui/qpagelayout.h>
diff --git a/src/printsupport/kernel/qprint_p.h b/src/printsupport/kernel/qprint_p.h
index 47dfce3787..280c2d7608 100644
--- a/src/printsupport/kernel/qprint_p.h
+++ b/src/printsupport/kernel/qprint_p.h
@@ -57,7 +57,7 @@
#include <QtCore/qstring.h>
#include <QtCore/qlist.h>
-#if (defined Q_OS_OSX) || (defined Q_OS_UNIX && !defined QT_NO_CUPS)
+#if (defined Q_OS_MACOS) || (defined Q_OS_UNIX && QT_CONFIG(cups))
#include <cups/ppd.h> // Use for type defs only, don't want to actually link in main module
#endif
@@ -245,7 +245,7 @@ public:
return QByteArray();
}
-#if (defined Q_OS_OSX) || (defined Q_OS_UNIX && !defined QT_NO_CUPS)
+#if (defined Q_OS_MACOS) || (defined Q_OS_UNIX && QT_CONFIG(cups))
// PPD utilities shared by CUPS and Mac plugins requiring CUPS headers
// May turn into a proper internal QPpd class if enough shared between Mac and CUPS,
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index 638187c614..d59db444e4 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -55,7 +55,9 @@
#include "qprintengine_pdf_p.h"
#include <qpicture.h>
+#if QT_CONFIG(printpreviewwidget)
#include <private/qpaintengine_preview_p.h>
+#endif
QT_BEGIN_NAMESPACE
@@ -186,7 +188,7 @@ void QPrinterPrivate::changeEngines(QPrinter::OutputFormat format, const QPrinte
delete oldPrintEngine;
}
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+#if QT_CONFIG(printpreviewwidget)
QList<const QPicture *> QPrinterPrivate::previewPages() const
{
if (previewEngine)
@@ -211,7 +213,7 @@ void QPrinterPrivate::setPreviewMode(bool enable)
use_default_engine = had_default_engines;
}
}
-#endif // QT_NO_PRINTPREVIEWWIDGET
+#endif // QT_CONFIG(printpreviewwidget)
void QPrinterPrivate::setProperty(QPrintEngine::PrintEnginePropertyKey key, const QVariant &value)
{
@@ -624,7 +626,7 @@ QPrinter::~QPrinter()
Q_D(QPrinter);
if (d->use_default_engine)
delete d->printEngine;
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+#if QT_CONFIG(printpreviewwidget)
delete d->previewEngine;
#endif
}
diff --git a/src/printsupport/kernel/qprinter_p.h b/src/printsupport/kernel/qprinter_p.h
index 8f962ea051..6ced466236 100644
--- a/src/printsupport/kernel/qprinter_p.h
+++ b/src/printsupport/kernel/qprinter_p.h
@@ -80,7 +80,7 @@ public:
paintEngine(0),
realPrintEngine(0),
realPaintEngine(0),
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+#if QT_CONFIG(printpreviewwidget)
previewEngine(0),
#endif
q_ptr(printer),
@@ -99,7 +99,7 @@ public:
QPrinterInfo findValidPrinter(const QPrinterInfo &printer = QPrinterInfo());
void initEngines(QPrinter::OutputFormat format, const QPrinterInfo &printer);
void changeEngines(QPrinter::OutputFormat format, const QPrinterInfo &printer);
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+#if QT_CONFIG(printpreviewwidget)
QList<const QPicture *> previewPages() const;
void setPreviewMode(bool);
#endif
@@ -114,7 +114,7 @@ public:
QPrintEngine *realPrintEngine;
QPaintEngine *realPaintEngine;
-#ifndef QT_NO_PRINTPREVIEWWIDGET
+#if QT_CONFIG(printpreviewwidget)
QPreviewPaintEngine *previewEngine;
#endif