Convert features.printpreviewwidget to QT_[REQUIRE_]CONFIG

Change-Id: I7e38179acd93bf8c7c48c79ff5e304d893460758
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Stephan Binner 2017-05-29 17:11:20 +02:00
parent e0b39313b0
commit f209215c0d
8 changed files with 19 additions and 22 deletions

View File

@ -1,6 +1,5 @@
HEADERS += \ HEADERS += \
$$PWD/qpaintengine_alpha_p.h \ $$PWD/qpaintengine_alpha_p.h \
$$PWD/qpaintengine_preview_p.h \
$$PWD/qprint_p.h \ $$PWD/qprint_p.h \
$$PWD/qprintdevice_p.h \ $$PWD/qprintdevice_p.h \
$$PWD/qprintengine.h \ $$PWD/qprintengine.h \
@ -16,7 +15,6 @@ HEADERS += \
SOURCES += \ SOURCES += \
$$PWD/qpaintengine_alpha.cpp \ $$PWD/qpaintengine_alpha.cpp \
$$PWD/qpaintengine_preview.cpp \
$$PWD/qprintdevice.cpp \ $$PWD/qprintdevice.cpp \
$$PWD/qprintengine_pdf.cpp \ $$PWD/qprintengine_pdf.cpp \
$$PWD/qprinter.cpp \ $$PWD/qprinter.cpp \
@ -25,6 +23,11 @@ SOURCES += \
$$PWD/qplatformprintplugin.cpp \ $$PWD/qplatformprintplugin.cpp \
$$PWD/qplatformprintersupport.cpp $$PWD/qplatformprintersupport.cpp
qtConfig(printpreviewwidget) {
HEADERS += $$PWD/qpaintengine_preview_p.h
SOURCES += $$PWD/qpaintengine_preview.cpp
}
win32 { win32 {
HEADERS += \ HEADERS += \
$$PWD/qprintengine_win_p.h $$PWD/qprintengine_win_p.h

View File

@ -46,7 +46,6 @@
#include <QtGui/qpainter.h> #include <QtGui/qpainter.h>
#include <QtGui/qpicture.h> #include <QtGui/qpicture.h>
#ifndef QT_NO_PRINTPREVIEWWIDGET
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QPreviewPaintEnginePrivate : public QPaintEnginePrivate class QPreviewPaintEnginePrivate : public QPaintEnginePrivate
@ -218,5 +217,3 @@ QPrinter::PrinterState QPreviewPaintEngine::printerState() const
} }
QT_END_NAMESPACE QT_END_NAMESPACE
#endif

View File

@ -56,7 +56,7 @@
#include <QtGui/qpaintengine.h> #include <QtGui/qpaintengine.h>
#include <QtPrintSupport/qprintengine.h> #include <QtPrintSupport/qprintengine.h>
#ifndef QT_NO_PRINTPREVIEWWIDGET QT_REQUIRE_CONFIG(printpreviewwidget);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -100,6 +100,4 @@ public:
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_PRINTPREVIEWWIDGET
#endif #endif

View File

@ -55,7 +55,9 @@
#include "qprintengine_pdf_p.h" #include "qprintengine_pdf_p.h"
#include <qpicture.h> #include <qpicture.h>
#if QT_CONFIG(printpreviewwidget)
#include <private/qpaintengine_preview_p.h> #include <private/qpaintengine_preview_p.h>
#endif
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -185,7 +187,7 @@ void QPrinterPrivate::changeEngines(QPrinter::OutputFormat format, const QPrinte
delete oldPrintEngine; delete oldPrintEngine;
} }
#ifndef QT_NO_PRINTPREVIEWWIDGET #if QT_CONFIG(printpreviewwidget)
QList<const QPicture *> QPrinterPrivate::previewPages() const QList<const QPicture *> QPrinterPrivate::previewPages() const
{ {
if (previewEngine) if (previewEngine)
@ -210,7 +212,7 @@ void QPrinterPrivate::setPreviewMode(bool enable)
use_default_engine = had_default_engines; use_default_engine = had_default_engines;
} }
} }
#endif // QT_NO_PRINTPREVIEWWIDGET #endif // QT_CONFIG(printpreviewwidget)
void QPrinterPrivate::setProperty(QPrintEngine::PrintEnginePropertyKey key, const QVariant &value) void QPrinterPrivate::setProperty(QPrintEngine::PrintEnginePropertyKey key, const QVariant &value)
{ {
@ -623,7 +625,7 @@ QPrinter::~QPrinter()
Q_D(QPrinter); Q_D(QPrinter);
if (d->use_default_engine) if (d->use_default_engine)
delete d->printEngine; delete d->printEngine;
#ifndef QT_NO_PRINTPREVIEWWIDGET #if QT_CONFIG(printpreviewwidget)
delete d->previewEngine; delete d->previewEngine;
#endif #endif
} }

View File

@ -79,7 +79,7 @@ public:
paintEngine(0), paintEngine(0),
realPrintEngine(0), realPrintEngine(0),
realPaintEngine(0), realPaintEngine(0),
#ifndef QT_NO_PRINTPREVIEWWIDGET #if QT_CONFIG(printpreviewwidget)
previewEngine(0), previewEngine(0),
#endif #endif
q_ptr(printer), q_ptr(printer),
@ -98,7 +98,7 @@ public:
QPrinterInfo findValidPrinter(const QPrinterInfo &printer = QPrinterInfo()); QPrinterInfo findValidPrinter(const QPrinterInfo &printer = QPrinterInfo());
void initEngines(QPrinter::OutputFormat format, const QPrinterInfo &printer); void initEngines(QPrinter::OutputFormat format, const QPrinterInfo &printer);
void changeEngines(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; QList<const QPicture *> previewPages() const;
void setPreviewMode(bool); void setPreviewMode(bool);
#endif #endif
@ -112,7 +112,7 @@ public:
QPrintEngine *realPrintEngine; QPrintEngine *realPrintEngine;
QPaintEngine *realPaintEngine; QPaintEngine *realPaintEngine;
#ifndef QT_NO_PRINTPREVIEWWIDGET #if QT_CONFIG(printpreviewwidget)
QPreviewPaintEngine *previewEngine; QPreviewPaintEngine *previewEngine;
#endif #endif

View File

@ -48,8 +48,6 @@
#include <QtWidgets/qscrollbar.h> #include <QtWidgets/qscrollbar.h>
#include <QtWidgets/qstyleoption.h> #include <QtWidgets/qstyleoption.h>
#ifndef QT_NO_PRINTPREVIEWWIDGET
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
namespace { namespace {
@ -831,5 +829,3 @@ QT_END_NAMESPACE
#include "moc_qprintpreviewwidget.cpp" #include "moc_qprintpreviewwidget.cpp"
#include "qprintpreviewwidget.moc" #include "qprintpreviewwidget.moc"
#endif // QT_NO_PRINTPREVIEWWIDGET

View File

@ -44,7 +44,7 @@
#include <QtWidgets/qwidget.h> #include <QtWidgets/qwidget.h>
#include <QtPrintSupport/qprinter.h> #include <QtPrintSupport/qprinter.h>
#ifndef QT_NO_PRINTPREVIEWWIDGET QT_REQUIRE_CONFIG(printpreviewwidget);
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -114,5 +114,4 @@ private:
QT_END_NAMESPACE QT_END_NAMESPACE
#endif // QT_NO_PRINTPREVIEWWIDGET
#endif // QPRINTPREVIEWWIDGET_H #endif // QPRINTPREVIEWWIDGET_H

View File

@ -1,5 +1,7 @@
HEADERS += widgets/qprintpreviewwidget.h qtConfig(printpreviewwidget) {
SOURCES += widgets/qprintpreviewwidget.cpp HEADERS += widgets/qprintpreviewwidget.h
SOURCES += widgets/qprintpreviewwidget.cpp
}
unix:!darwin:qtConfig(cupsjobwidget) { unix:!darwin:qtConfig(cupsjobwidget) {
HEADERS += widgets/qcupsjobwidget_p.h HEADERS += widgets/qcupsjobwidget_p.h