Cocoa: Set NSImage (point) size

when converting from QPixmap. This will make the image
display correctly when used by native API.

Task-number: QTBUG-60769
Change-Id: Iec3160affbe2902d34a219b6816f503dc2f56f74
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
bb10
Morten Johan Sørvig 2017-11-08 01:02:28 +01:00 committed by Liang Qi
parent ecc4754cab
commit 7416fc5e80
1 changed files with 1 additions and 0 deletions

View File

@ -110,6 +110,7 @@ NSImage *qt_mac_create_nsimage(const QPixmap &pm)
QImage image = pm.toImage();
CGImageRef cgImage = qt_mac_toCGImage(image);
NSImage *nsImage = qt_mac_cgimage_to_nsimage(cgImage);
nsImage.size = (pm.size() / pm.devicePixelRatioF()).toCGSize();
CGImageRelease(cgImage);
return nsImage;
}