QT5 -- Mac fixups for building with 4.8.4

.. missed off earlier commits.
This commit is contained in:
Mark Liversedge
2013-12-10 20:21:32 +00:00
parent f8763e6379
commit 16cd65377d
2 changed files with 14 additions and 1 deletions

View File

@@ -18,9 +18,12 @@
#include "QtMacButton.h"
#if QT_VERSION > 0x050000
// mac specials
#include <qmacfunctions.h>
#include <QtWidgets>
#include <qmacfunctions.h>
#endif
#include <Cocoa/Cocoa.h>
#include <QMacCocoaViewContainer>
@@ -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];

View File

@@ -18,8 +18,10 @@
#include "QtMacSegmentedButton.h"
#if QT_VERSION > 0x050000
// mac specials
#include <qmacfunctions.h>
#endif
#import <AppKit/NSButton.h>
#import <AppKit/NSApplication.h>
@@ -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];