mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-01-28 16:20:26 +01:00
Use QPixmap::toImage() and QImage.toCGImage() instead
This commit is contained in:
parent
4dccb40bf9
commit
a33e6c03e4
@ -22,9 +22,11 @@ THE SOFTWARE.
|
||||
|
||||
#include <AppKit/NSImage.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <QByteArray>
|
||||
#include <QString>
|
||||
#include <QImage>
|
||||
#include <QPixmap>
|
||||
#include <QBoxLayout>
|
||||
#include <QtMacExtras>
|
||||
#include <QMacCocoaViewContainer>
|
||||
|
||||
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];
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user