Replace use of QtMac::toCGImageRef with QImage::toCGImage

This commit is contained in:
Jonas Kvinge 2020-01-05 00:46:54 +01:00
parent 0308a3f9a5
commit 35a0beb8a8
1 changed files with 3 additions and 2 deletions

View File

@ -24,8 +24,9 @@ THE SOFTWARE.
#include <Foundation/NSString.h>
#include <QMacCocoaViewContainer>
#include <QString>
#include <QImage>
#include <QPixmap>
#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];
}