From a33e6c03e4424b74cb17a1615d89c6ee4c24d287 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Fri, 16 Aug 2019 22:26:30 +0200 Subject: [PATCH] Use QPixmap::toImage() and QImage.toCGImage() instead --- src/widgets/qocoa_mac.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/widgets/qocoa_mac.h b/src/widgets/qocoa_mac.h index 1a58e3523..50375bbd6 100644 --- a/src/widgets/qocoa_mac.h +++ b/src/widgets/qocoa_mac.h @@ -22,9 +22,11 @@ THE SOFTWARE. #include #include +#include #include +#include +#include #include -#include #include static inline NSString* fromQString(const QString &string) { @@ -44,7 +46,8 @@ static inline QString toQString(NSString *string) { static inline NSImage* fromQPixmap(const QPixmap &pixmap) { - CGImageRef cgImage = QtMac::toCGImageRef(pixmap); + QImage image = pixmap.toImage(); + CGImageRef cgImage = image.toCGImage(); return [ [NSImage alloc] initWithCGImage:cgImage size:NSZeroSize]; }