From 16cd65377d1cb8cf3e7caf64f3e225f80606daeb Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Tue, 10 Dec 2013 20:21:32 +0000 Subject: [PATCH] QT5 -- Mac fixups for building with 4.8.4 .. missed off earlier commits. --- src/QtMacButton.mm | 9 ++++++++- src/QtMacSegmentedButton.mm | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/QtMacButton.mm b/src/QtMacButton.mm index 7431814bb..12ab70cfb 100644 --- a/src/QtMacButton.mm +++ b/src/QtMacButton.mm @@ -18,9 +18,12 @@ #include "QtMacButton.h" +#if QT_VERSION > 0x050000 // mac specials -#include #include +#include +#endif + #include #include @@ -29,7 +32,11 @@ static NSImage *fromQPixmap(const QPixmap *pixmap) { +#if QT_VERSION > 0x050000 CGImageRef cgImage = QtMac::toCGImageRef(*pixmap); +#else + CGImageRef cgImage = pixmap->toMacCGImageRef(); +#endif NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage]; NSImage *image = [[[NSImage alloc] init] autorelease]; [image addRepresentation:bitmapRep]; diff --git a/src/QtMacSegmentedButton.mm b/src/QtMacSegmentedButton.mm index 5b2ab75e0..220e7cc7e 100644 --- a/src/QtMacSegmentedButton.mm +++ b/src/QtMacSegmentedButton.mm @@ -18,8 +18,10 @@ #include "QtMacSegmentedButton.h" +#if QT_VERSION > 0x050000 // mac specials #include +#endif #import #import @@ -48,7 +50,11 @@ static inline NSString *darwinQStringToNSString (const QString &aString) static NSImage *fromQPixmap(const QPixmap *pixmap) { +#if QT_VERSION > 0x050000 CGImageRef cgImage = QtMac::toCGImageRef(*pixmap); +#else + CGImageRef cgImage = pixmap->toMacCGImageRef(); +#endif NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage:cgImage]; NSImage *image = [[[NSImage alloc] init] autorelease]; [image addRepresentation:bitmapRep];