diff --git a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm index 873fa3eed9..a53a6bca46 100644 --- a/src/plugins/platforms/cocoa/qcocoanativeinterface.mm +++ b/src/plugins/platforms/cocoa/qcocoanativeinterface.mm @@ -133,7 +133,7 @@ void QCocoaNativeInterface::beep() QPlatformPrinterSupport *QCocoaNativeInterface::createPlatformPrinterSupport() { -#ifndef QT_NO_WIDGETS +#if !defined(QT_NO_WIDGETS) && !defined(QT_NO_PRINTER) return new QCocoaPrinterSupport(); #else qFatal("Printing is not supported when Qt is configured with -no-widgets"); @@ -143,7 +143,7 @@ QPlatformPrinterSupport *QCocoaNativeInterface::createPlatformPrinterSupport() void *QCocoaNativeInterface::NSPrintInfoForPrintEngine(QPrintEngine *printEngine) { -#ifndef QT_NO_WIDGETS +#if !defined(QT_NO_WIDGETS) && !defined(QT_NO_PRINTER) QMacPrintEnginePrivate *macPrintEnginePriv = static_cast(printEngine)->d_func(); if (macPrintEnginePriv->state == QPrinter::Idle && !macPrintEnginePriv->isPrintSessionInitialized()) macPrintEnginePriv->initialize(); diff --git a/src/plugins/platforms/cocoa/qcocoaprintersupport.h b/src/plugins/platforms/cocoa/qcocoaprintersupport.h index 83cf1ffada..a48790ef34 100644 --- a/src/plugins/platforms/cocoa/qcocoaprintersupport.h +++ b/src/plugins/platforms/cocoa/qcocoaprintersupport.h @@ -43,6 +43,7 @@ #define QCOCOAPRINTERSUPPORT_H #include +#ifndef QT_NO_PRINTER #include "qt_mac_p.h" @@ -64,4 +65,5 @@ private: QPrinterInfo printerInfoFromPMPrinter(const PMPrinter &printer); }; +#endif // QT_NO_PRINTER #endif // QCOCOAPRINTERSUPPORT_H diff --git a/src/plugins/platforms/cocoa/qcocoaprintersupport.mm b/src/plugins/platforms/cocoa/qcocoaprintersupport.mm index cfa23b7a30..cb2aa7132b 100644 --- a/src/plugins/platforms/cocoa/qcocoaprintersupport.mm +++ b/src/plugins/platforms/cocoa/qcocoaprintersupport.mm @@ -40,6 +40,8 @@ ****************************************************************************/ #include "qcocoaprintersupport.h" + +#ifndef QT_NO_PRINTER #include "qprintengine_mac_p.h" #include @@ -169,3 +171,5 @@ QList > QCocoaPrinterSupport::supportedSizesWithNames(con PMRelease(printer); return returnValue; } + +#endif //QT_NO_PRINTER diff --git a/src/plugins/platforms/cocoa/qpaintengine_mac.mm b/src/plugins/platforms/cocoa/qpaintengine_mac.mm index dc3757ce3c..40d60a6a0a 100644 --- a/src/plugins/platforms/cocoa/qpaintengine_mac.mm +++ b/src/plugins/platforms/cocoa/qpaintengine_mac.mm @@ -117,8 +117,10 @@ static void qt_mac_clip_cg(CGContextRef hd, const QRegion &rgn, CGAffineTransfor QMacCGContext::QMacCGContext(QPainter *p) { QPaintEngine *pe = p->paintEngine(); +#ifndef QT_NO_PRINTER if (pe->type() == QPaintEngine::MacPrinter) pe = static_cast(pe)->paintEngine(); +#endif pe->syncState(); context = 0; if (pe->type() == QPaintEngine::CoreGraphics) diff --git a/src/printsupport/dialogs/qpagesetupdialog_mac.mm b/src/printsupport/dialogs/qpagesetupdialog_mac.mm index 967f127b86..7180c01df4 100644 --- a/src/printsupport/dialogs/qpagesetupdialog_mac.mm +++ b/src/printsupport/dialogs/qpagesetupdialog_mac.mm @@ -39,11 +39,12 @@ ** ****************************************************************************/ -#ifndef QT_NO_PRINTDIALOG #include #include "qpagesetupdialog.h" + +#ifndef QT_NO_PRINTDIALOG #include "qpagesetupdialog_p.h" #include diff --git a/src/printsupport/dialogs/qprintdialog_mac.mm b/src/printsupport/dialogs/qprintdialog_mac.mm index 37333f2593..bf1617065b 100644 --- a/src/printsupport/dialogs/qprintdialog_mac.mm +++ b/src/printsupport/dialogs/qprintdialog_mac.mm @@ -39,8 +39,6 @@ ** ****************************************************************************/ -#ifndef QT_NO_PRINTDIALOG - #include #include "qprintdialog.h" @@ -52,6 +50,8 @@ #include #include +#ifndef QT_NO_PRINTDIALOG + QT_BEGIN_NAMESPACE class QPrintDialogPrivate : public QAbstractPrintDialogPrivate