diff --git src/gui/painting/qcoregraphics.mm src/gui/painting/qcoregraphics.mm
index c4fb8afc64eef280652208c3c4bf67f9a7b5c237..5d95014b94297c534973dca91c3e869bb86887a2 100644
--- src/gui/painting/qcoregraphics.mm
+++ src/gui/painting/qcoregraphics.mm
@@ -147,7 +147,13 @@ QPixmap qt_mac_toQPixmap(const NSImage *image, const QSizeF &size)
     QMacCGContext ctx(&pixmap);
     if (!ctx)
         return QPixmap();
-    NSGraphicsContext *gc = [NSGraphicsContext graphicsContextWithCGContext:ctx flipped:YES];
+    NSGraphicsContext *gc;
+#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_10, __IPHONE_NA)
+    if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_10)
+        gc = [NSGraphicsContext graphicsContextWithCGContext:ctx flipped:YES];
+    else
+#endif
+        gc = [NSGraphicsContext graphicsContextWithGraphicsPort:ctx flipped:YES];
     if (!gc)
         return QPixmap();
     [NSGraphicsContext saveGraphicsState];
