Fix QT_NO_PRINTER build on Mac
On Mac the QT_NO_PRINTER build was not implemented. Task-number: QTBUG-33565 Change-Id: I118472f9400aa0a0d0e192ae39a11ea38a66f340 Reviewed-by: John Layt <jlayt@kde.org>
This commit is contained in:
parent
77dc33dcdb
commit
5889b239b1
@ -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<QMacPrintEngine *>(printEngine)->d_func();
|
||||
if (macPrintEnginePriv->state == QPrinter::Idle && !macPrintEnginePriv->isPrintSessionInitialized())
|
||||
macPrintEnginePriv->initialize();
|
||||
|
@ -43,6 +43,7 @@
|
||||
#define QCOCOAPRINTERSUPPORT_H
|
||||
|
||||
#include <qpa/qplatformprintersupport.h>
|
||||
#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
|
||||
|
@ -40,6 +40,8 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "qcocoaprintersupport.h"
|
||||
|
||||
#ifndef QT_NO_PRINTER
|
||||
#include "qprintengine_mac_p.h"
|
||||
|
||||
#include <QtPrintSupport/QPrinter>
|
||||
@ -169,3 +171,5 @@ QList<QPair<QString, QSizeF> > QCocoaPrinterSupport::supportedSizesWithNames(con
|
||||
PMRelease(printer);
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
#endif //QT_NO_PRINTER
|
||||
|
@ -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<QMacPrintEngine*>(pe)->paintEngine();
|
||||
#endif
|
||||
pe->syncState();
|
||||
context = 0;
|
||||
if (pe->type() == QPaintEngine::CoreGraphics)
|
||||
|
@ -39,11 +39,12 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QT_NO_PRINTDIALOG
|
||||
|
||||
#include <Cocoa/Cocoa.h>
|
||||
|
||||
#include "qpagesetupdialog.h"
|
||||
|
||||
#ifndef QT_NO_PRINTDIALOG
|
||||
#include "qpagesetupdialog_p.h"
|
||||
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
|
@ -39,8 +39,6 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QT_NO_PRINTDIALOG
|
||||
|
||||
#include <Cocoa/Cocoa.h>
|
||||
|
||||
#include "qprintdialog.h"
|
||||
@ -52,6 +50,8 @@
|
||||
#include <QtPrintSupport/qprinter.h>
|
||||
#include <QtPrintSupport/qprintengine.h>
|
||||
|
||||
#ifndef QT_NO_PRINTDIALOG
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QPrintDialogPrivate : public QAbstractPrintDialogPrivate
|
||||
|
Loading…
Reference in New Issue
Block a user