Cocoa: Compile when configured with -no-widgets
Build printing only if Qt is configured with widget support. This is mostly useful for testing -no-widgets builds. Change-Id: I2d47b420e311869e85508db1f7372fe326617dec Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
This commit is contained in:
parent
f100f84703
commit
3abf49cdc8
@ -34,9 +34,6 @@ OBJECTIVE_SOURCES += main.mm \
|
|||||||
qmacmime.mm \
|
qmacmime.mm \
|
||||||
qcocoasystemsettings.mm \
|
qcocoasystemsettings.mm \
|
||||||
qcocoainputcontext.mm \
|
qcocoainputcontext.mm \
|
||||||
qpaintengine_mac.mm \
|
|
||||||
qprintengine_mac.mm \
|
|
||||||
qcocoaprintersupport.mm \
|
|
||||||
qcocoaservices.mm \
|
qcocoaservices.mm \
|
||||||
|
|
||||||
HEADERS += qcocoaintegration.h \
|
HEADERS += qcocoaintegration.h \
|
||||||
@ -69,16 +66,27 @@ HEADERS += qcocoaintegration.h \
|
|||||||
qmacmime.h \
|
qmacmime.h \
|
||||||
qcocoasystemsettings.h \
|
qcocoasystemsettings.h \
|
||||||
qcocoainputcontext.h \
|
qcocoainputcontext.h \
|
||||||
qpaintengine_mac_p.h \
|
|
||||||
qprintengine_mac_p.h \
|
|
||||||
qcocoaprintersupport.h \
|
|
||||||
qcocoaservices.h \
|
qcocoaservices.h \
|
||||||
|
|
||||||
RESOURCES += qcocoaresources.qrc
|
RESOURCES += qcocoaresources.qrc
|
||||||
|
|
||||||
LIBS += -framework Cocoa -framework IOKit
|
LIBS += -framework Cocoa -framework IOKit
|
||||||
|
|
||||||
QT += core-private gui-private widgets-private platformsupport-private printsupport-private
|
QT += core-private gui-private platformsupport-private
|
||||||
|
|
||||||
|
!contains(QT_CONFIG, no-widgets) {
|
||||||
|
OBJECTIVE_SOURCES += \
|
||||||
|
qpaintengine_mac.mm \
|
||||||
|
qprintengine_mac.mm \
|
||||||
|
qcocoaprintersupport.mm \
|
||||||
|
|
||||||
|
HEADERS += \
|
||||||
|
qpaintengine_mac_p.h \
|
||||||
|
qprintengine_mac_p.h \
|
||||||
|
qcocoaprintersupport.h \
|
||||||
|
|
||||||
|
QT += widgets-private printsupport-private
|
||||||
|
}
|
||||||
|
|
||||||
OTHER_FILES += cocoa.json
|
OTHER_FILES += cocoa.json
|
||||||
target.path += $$[QT_INSTALL_PLUGINS]/platforms
|
target.path += $$[QT_INSTALL_PLUGINS]/platforms
|
||||||
|
@ -43,11 +43,12 @@
|
|||||||
#define QCOCOANATIVEINTERFACE_H
|
#define QCOCOANATIVEINTERFACE_H
|
||||||
|
|
||||||
#include <qpa/qplatformnativeinterface.h>
|
#include <qpa/qplatformnativeinterface.h>
|
||||||
#include <qpa/qplatformprintersupport.h>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
class QPlatformPrinterSupport;
|
||||||
|
class QPrintEngine;
|
||||||
|
|
||||||
class QCocoaNativeInterface : public QPlatformNativeInterface
|
class QCocoaNativeInterface : public QPlatformNativeInterface
|
||||||
{
|
{
|
||||||
|
@ -42,7 +42,6 @@
|
|||||||
#include "qcocoanativeinterface.h"
|
#include "qcocoanativeinterface.h"
|
||||||
#include "qcocoaglcontext.h"
|
#include "qcocoaglcontext.h"
|
||||||
#include "qcocoawindow.h"
|
#include "qcocoawindow.h"
|
||||||
#include "qcocoaprintersupport.h"
|
|
||||||
#include "qcocoamenubar.h"
|
#include "qcocoamenubar.h"
|
||||||
|
|
||||||
#include <qbytearray.h>
|
#include <qbytearray.h>
|
||||||
@ -54,7 +53,11 @@
|
|||||||
#include "qguiapplication.h"
|
#include "qguiapplication.h"
|
||||||
#include <qdebug.h>
|
#include <qdebug.h>
|
||||||
|
|
||||||
|
#ifndef QT_NO_WIDGETS
|
||||||
|
#include "qcocoaprintersupport.h"
|
||||||
#include "qprintengine_mac_p.h"
|
#include "qprintengine_mac_p.h"
|
||||||
|
#include <qpa/qplatformprintersupport.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -81,13 +84,23 @@ void *QCocoaNativeInterface::nativeResourceForWindow(const QByteArray &resourceS
|
|||||||
|
|
||||||
QPlatformPrinterSupport *QCocoaNativeInterface::createPlatformPrinterSupport()
|
QPlatformPrinterSupport *QCocoaNativeInterface::createPlatformPrinterSupport()
|
||||||
{
|
{
|
||||||
|
#ifndef QT_NO_WIDGETS
|
||||||
return new QCocoaPrinterSupport();
|
return new QCocoaPrinterSupport();
|
||||||
|
#else
|
||||||
|
qFatal("Printing is not supported when Qt is configured with -no-widgets");
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void *QCocoaNativeInterface::NSPrintInfoForPrintEngine(QPrintEngine *printEngine)
|
void *QCocoaNativeInterface::NSPrintInfoForPrintEngine(QPrintEngine *printEngine)
|
||||||
{
|
{
|
||||||
|
#ifndef QT_NO_WIDGETS
|
||||||
QMacPrintEngine *macPrintEngine = static_cast<QMacPrintEngine *>(printEngine);
|
QMacPrintEngine *macPrintEngine = static_cast<QMacPrintEngine *>(printEngine);
|
||||||
return macPrintEngine->d_func()->printInfo;
|
return macPrintEngine->d_func()->printInfo;
|
||||||
|
#else
|
||||||
|
qFatal("Printing is not supported when Qt is configured with -no-widgets");
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void QCocoaNativeInterface::onAppFocusWindowChanged(QWindow *window)
|
void QCocoaNativeInterface::onAppFocusWindowChanged(QWindow *window)
|
||||||
|
Loading…
Reference in New Issue
Block a user