Fix notification display on macOS

This commit is contained in:
vit9696
2017-08-15 21:16:37 +03:00
parent f98edcab5c
commit eb8ff91c5d
3 changed files with 16 additions and 1 deletions

View File

@@ -69,3 +69,15 @@ void overrideDockClickHandler(bool (*dockClickHandler)(id, SEL, ...))
qWarning("Failed to register dock click handler");
}
}
void displayNotification(const QString &title, const QString &message)
{
@autoreleasepool {
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.title = title.toNSString();
notification.informativeText = message.toNSString();
notification.soundName = NSUserNotificationDefaultSoundName;
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
}
}