mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 00:28:42 +00:00
QT5 -- Mac fixups for building with 4.8.4
.. missed off earlier commits.
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user