diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-12-14 12:32:35 +0100 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-12-14 19:35:38 +0000 |
commit | fddc5a27b180d7afde37e2c004cee95302e907ed (patch) | |
tree | db71b944282a16d788706956d403f9ffa5a87aa4 | |
parent | dc0bb57f8600374b7279d5c14456a33a9d0c0476 (diff) |
macOS: Enable using CoreGraphics helper functions from C++ sources
Change-Id: If32c96d224bfb90ba22661b6f5ac3c920acb39d2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
-rw-r--r-- | src/gui/painting/qcoregraphics_p.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/painting/qcoregraphics_p.h b/src/gui/painting/qcoregraphics_p.h index d74c4d0711..6b6a1e800e 100644 --- a/src/gui/painting/qcoregraphics_p.h +++ b/src/gui/painting/qcoregraphics_p.h @@ -56,13 +56,15 @@ #include <QtGui/qpalette.h> #include <CoreGraphics/CoreGraphics.h> -#ifdef Q_OS_MACOS + +#if defined(__OBJC__) && defined(Q_OS_MACOS) #include <AppKit/AppKit.h> +#define HAVE_APPKIT #endif QT_BEGIN_NAMESPACE -#ifdef Q_OS_MACOS +#ifdef HAVE_APPKIT Q_GUI_EXPORT NSImage *qt_mac_create_nsimage(const QPixmap &pm); Q_GUI_EXPORT NSImage *qt_mac_create_nsimage(const QIcon &icon, int defaultSize = 0); Q_GUI_EXPORT QPixmap qt_mac_toQPixmap(const NSImage *image, const QSizeF &size); @@ -78,7 +80,7 @@ Q_GUI_EXPORT CGColorSpaceRef qt_mac_colorSpaceForDeviceType(const QPaintDevice * Q_GUI_EXPORT void qt_mac_clip_cg(CGContextRef hd, const QRegion &rgn, CGAffineTransform *orig_xform); -#ifdef Q_OS_MACOS +#ifdef HAVE_APPKIT Q_GUI_EXPORT QColor qt_mac_toQColor(const NSColor *color); Q_GUI_EXPORT QBrush qt_mac_toQBrush(const NSColor *color, QPalette::ColorGroup colorGroup = QPalette::Normal); #endif @@ -124,4 +126,6 @@ private: QT_END_NAMESPACE +#undef HAVE_APPKIT + #endif // QCOREGRAPHICS_P_H |