Ticket #62964: patch-backport-gui-109.diff

File patch-backport-gui-109.diff, 928 bytes (added by Wowfunhappy (Jonathan), 3 years ago)
  • src/gui/painting/qcoregraphics.mm

    diff --git src/gui/painting/qcoregraphics.mm src/gui/painting/qcoregraphics.mm
    index c4fb8afc64eef280652208c3c4bf67f9a7b5c237..5d95014b94297c534973dca91c3e869bb86887a2 100644
    QPixmap qt_mac_toQPixmap(const NSImage *image, const QSizeF &size) 
    147147    QMacCGContext ctx(&pixmap);
    148148    if (!ctx)
    149149        return QPixmap();
    150     NSGraphicsContext *gc = [NSGraphicsContext graphicsContextWithCGContext:ctx flipped:YES];
     150    NSGraphicsContext *gc;
     151#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_10, __IPHONE_NA)
     152    if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_10)
     153        gc = [NSGraphicsContext graphicsContextWithCGContext:ctx flipped:YES];
     154    else
     155#endif
     156        gc = [NSGraphicsContext graphicsContextWithGraphicsPort:ctx flipped:YES];
    151157    if (!gc)
    152158        return QPixmap();
    153159    [NSGraphicsContext saveGraphicsState];