Skip to content

Commit

Permalink
fix QtMac::toNSImage being deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Sep 21, 2020
1 parent 1c1febc commit 2566458
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/native/mac/qgsmacnative.mm
Expand Up @@ -60,7 +60,10 @@ - ( BOOL )userNotificationCenter:( NSUserNotificationCenter * )center shouldPres

void QgsMacNative::setIconPath( const QString &iconPath )
{
mQgsUserNotificationCenter->_qgisIcon = QtMac::toNSImage( QPixmap( iconPath ) );
QImage image = QPixmap( iconPath ).toImage();
CGImageRef imgRef = image.toCGImage();
NSSize nsize = NSMakeSize((CGFloat)image.size().width(), (CGFloat)image.size().height());
mQgsUserNotificationCenter->_qgisIcon = [[NSImage alloc] initWithCGImage:imgRef size:nsize];
}

const char *QgsMacNative::currentAppLocalizedName()
Expand Down

0 comments on commit 2566458

Please sign in to comment.