QtPrintSupport - Fix QT_NO_PRINTER build
Fix the QT_NO_PRINTER build for issues that have accumulated over last few months, and in the new changes already approved. Change-Id: I9aed21dee861837fd1a68a96692c873a4f5be293 Reviewed-by: Lars Knoll <lars.knoll@digia.com>bb10
parent
69e9b12001
commit
833a43d56c
|
|
@ -53,11 +53,10 @@
|
|||
// We mean it.
|
||||
//
|
||||
|
||||
#include <QtCore/qfeatures.h> // Some feature dependencies might define QT_NO_PRINTER
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
#include <qpa/qplatformprintdevice.h>
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
#include "qt_mac_p.h"
|
||||
|
||||
#include <cups/ppd.h>
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
static QPrint::DuplexMode macToDuplexMode(const PMDuplexMode &mode)
|
||||
{
|
||||
if (mode == kPMDuplexTumble)
|
||||
|
|
@ -495,4 +497,6 @@ PMPaper QCocoaPrintDevice::macPaper(const QPageSize &pageSize) const
|
|||
return paper;
|
||||
}
|
||||
|
||||
#endif // QT_NO_PRINTER
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -43,11 +43,10 @@
|
|||
#ifndef QCUPSPRINTERSUPPORT_H
|
||||
#define QCUPSPRINTERSUPPORT_H
|
||||
|
||||
#include <QtCore/qfeatures.h> // Some feature dependencies might define QT_NO_PRINTER
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
#include <qpa/qplatformprintersupport.h>
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
#include <QtCore/qstringlist.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
QPpdPrintDevice::QPpdPrintDevice()
|
||||
: QPlatformPrintDevice(),
|
||||
m_cupsDest(0),
|
||||
|
|
@ -496,4 +498,6 @@ cups_ptype_e QPpdPrintDevice::printerTypeFlags() const
|
|||
return static_cast<cups_ptype_e>(printerOption("printer-type").toUInt());
|
||||
}
|
||||
|
||||
#endif // QT_NO_PRINTER
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -53,11 +53,10 @@
|
|||
// We mean it.
|
||||
//
|
||||
|
||||
#include <QtCore/qfeatures.h> // Some feature dependencies might define QT_NO_PRINTER
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
#include <qpa/qplatformprintdevice.h>
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
#include <cups/cups.h>
|
||||
#include <cups/ppd.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
extern qreal qt_pointMultiplier(QPageLayout::Unit unit);
|
||||
|
||||
static inline uint qwcsnlen(const wchar_t *str, uint maxlen)
|
||||
|
|
@ -469,4 +471,6 @@ QString QWindowsPrintDevice::defaultPrintDeviceId()
|
|||
return QString::fromWCharArray(name.data());
|
||||
}
|
||||
|
||||
#endif // QT_NO_PRINTER
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -53,11 +53,10 @@
|
|||
// We mean it.
|
||||
//
|
||||
|
||||
#include <QtCore/qfeatures.h> // Some feature dependencies might define QT_NO_PRINTER
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
#include <qpa/qplatformprintdevice.h>
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
#include <QtCore/qt_windows.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -53,10 +53,10 @@
|
|||
|
||||
#ifndef QT_NO_PRINTDIALOG
|
||||
|
||||
extern qreal qt_pointMultiplier(QPageLayout::Unit unit);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
extern qreal qt_pointMultiplier(QPageLayout::Unit unit);
|
||||
|
||||
class QPrintDialogPrivate : public QAbstractPrintDialogPrivate
|
||||
{
|
||||
Q_DECLARE_PUBLIC(QPrintDialog)
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
QPlatformPrintDevice::QPlatformPrintDevice()
|
||||
: m_isRemote(false),
|
||||
m_supportsMultipleCopies(false),
|
||||
|
|
@ -386,4 +388,6 @@ QPageSize QPlatformPrintDevice::createPageSize(int windowsId, const QSize &size,
|
|||
return QPageSize(windowsId, size, localizedName);
|
||||
}
|
||||
|
||||
#endif // QT_NO_PRINTER
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -53,8 +53,6 @@
|
|||
// We mean it.
|
||||
//
|
||||
|
||||
#include "qplatformprintdevice.h"
|
||||
|
||||
#include <private/qprint_p.h>
|
||||
|
||||
#include <QtCore/qvector.h>
|
||||
|
|
@ -63,6 +61,8 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
class Q_PRINTSUPPORT_EXPORT QPlatformPrintDevice : public QSharedData
|
||||
{
|
||||
public:
|
||||
|
|
@ -177,4 +177,6 @@ protected:
|
|||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_PRINTER
|
||||
|
||||
#endif // QPLATFORMPRINTDEVICE_H
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
QPrintDevice::QPrintDevice()
|
||||
: d(new QPlatformPrintDevice())
|
||||
{
|
||||
|
|
@ -248,4 +250,6 @@ QList<QMimeType> QPrintDevice::supportedMimeTypes() const
|
|||
return isValid() ? d->supportedMimeTypes() : QList<QMimeType>();
|
||||
}
|
||||
|
||||
#endif // QT_NO_PRINTER
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
class QPlatformPrintDevice;
|
||||
class QMarginsF;
|
||||
class QMimeType;
|
||||
|
|
@ -142,4 +144,6 @@ Q_DECLARE_SHARED(QPrintDevice)
|
|||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QT_NO_PRINTER
|
||||
|
||||
#endif // QPLATFORMPRINTDEVICE_H
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
/*!
|
||||
\internal
|
||||
\class QCupsJobWidget
|
||||
|
|
@ -212,4 +214,6 @@ QCUPSSupport::BannerPage QCupsJobWidget::endBannerPage() const
|
|||
return m_ui.endBannerPageCombo->itemData(m_ui.endBannerPageCombo->currentIndex()).value<QCUPSSupport::BannerPage>();
|
||||
}
|
||||
|
||||
#endif // QT_NO_PRINTER
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
||||
|
||||
class QString;
|
||||
class QTime;
|
||||
class QPrinter;
|
||||
|
|
@ -106,6 +108,8 @@ private:
|
|||
Q_DISABLE_COPY(QCupsJobWidget)
|
||||
};
|
||||
|
||||
#endif // QT_NO_PRINTER
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QCUPSJOBWIDGET_P_H
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ private slots:
|
|||
|
||||
void tst_QPrintDevice::basics()
|
||||
{
|
||||
#ifndef QT_NO_PRINTER
|
||||
QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get();
|
||||
if (!ps)
|
||||
QSKIP("Could not load platform plugin");
|
||||
|
|
@ -102,6 +103,7 @@ void tst_QPrintDevice::basics()
|
|||
printDevice.supportedColorModes();
|
||||
printDevice.supportedMimeTypes();
|
||||
}
|
||||
#endif // QT_NO_PRINTER
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QPrintDevice)
|
||||
|
|
|
|||
Loading…
Reference in New Issue