Merge pull request #6508 from jonaski/qocoa

Replace use of QtMac::toCGImageRef with QImage::toCGImage
This commit is contained in:
John Maguire 2020-01-05 01:14:57 +00:00 committed by GitHub
commit 63cd5d4918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -22,10 +22,11 @@ THE SOFTWARE.
#include <AppKit/NSImage.h>
#include <Foundation/NSString.h>
#include <QImage>
#include <QMacCocoaViewContainer>
#include <QPixmap>
#include <QString>
#include <QVBoxLayout>
#include <QtMacExtras>
static inline NSString* fromQString(const QString &string)
{
@ -43,7 +44,7 @@ static inline QString toQString(NSString *string)
static inline NSImage* fromQPixmap(const QPixmap &pixmap)
{
CGImageRef cgImage = QtMac::toCGImageRef(pixmap);
CGImageRef cgImage = pixmap.toImage().toCGImage();
return [[NSImage alloc] initWithCGImage:cgImage size:NSZeroSize];
}