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 += \
$$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

View File

@ -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

View File

@ -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

View File

@ -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
@ -185,7 +187,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)
@ -210,7 +212,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)
{
@ -623,7 +625,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
}

View File

@ -79,7 +79,7 @@ public:
paintEngine(0),
realPrintEngine(0),
realPaintEngine(0),
#ifndef QT_NO_PRINTPREVIEWWIDGET
#if QT_CONFIG(printpreviewwidget)
previewEngine(0),
#endif
q_ptr(printer),
@ -98,7 +98,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
@ -112,7 +112,7 @@ public:
QPrintEngine *realPrintEngine;
QPaintEngine *realPaintEngine;
#ifndef QT_NO_PRINTPREVIEWWIDGET
#if QT_CONFIG(printpreviewwidget)
QPreviewPaintEngine *previewEngine;
#endif

View File

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

View File

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

View File

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