qmacmime.mm \
qcocoasystemsettings.mm \
qcocoainputcontext.mm \
- qpaintengine_mac.mm \
- qprintengine_mac.mm \
- qcocoaprintersupport.mm \
qcocoaservices.mm \
HEADERS += qcocoaintegration.h \
qmacmime.h \
qcocoasystemsettings.h \
qcocoainputcontext.h \
- qpaintengine_mac_p.h \
- qprintengine_mac_p.h \
- qcocoaprintersupport.h \
qcocoaservices.h \
RESOURCES += qcocoaresources.qrc
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
target.path += $$[QT_INSTALL_PLUGINS]/platforms
#define QCOCOANATIVEINTERFACE_H
#include <qpa/qplatformnativeinterface.h>
-#include <qpa/qplatformprintersupport.h>
QT_BEGIN_NAMESPACE
class QWidget;
+class QPlatformPrinterSupport;
+class QPrintEngine;
class QCocoaNativeInterface : public QPlatformNativeInterface
{
#include "qcocoanativeinterface.h"
#include "qcocoaglcontext.h"
#include "qcocoawindow.h"
-#include "qcocoaprintersupport.h"
#include "qcocoamenubar.h"
#include <qbytearray.h>
#include "qguiapplication.h"
#include <qdebug.h>
+#ifndef QT_NO_WIDGETS
+#include "qcocoaprintersupport.h"
#include "qprintengine_mac_p.h"
+#include <qpa/qplatformprintersupport.h>
+#endif
QT_BEGIN_NAMESPACE
QPlatformPrinterSupport *QCocoaNativeInterface::createPlatformPrinterSupport()
{
+#ifndef QT_NO_WIDGETS
return new QCocoaPrinterSupport();
+#else
+ qFatal("Printing is not supported when Qt is configured with -no-widgets");
+ return 0;
+#endif
}
void *QCocoaNativeInterface::NSPrintInfoForPrintEngine(QPrintEngine *printEngine)
{
+#ifndef QT_NO_WIDGETS
QMacPrintEngine *macPrintEngine = static_cast<QMacPrintEngine *>(printEngine);
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)