You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

notification.mm 641 B

9 years ago
12345678910111213141516171819202122
  1. #include "notification.h"
  2. #import <cocoa/Cocoa.h>
  3. Notification::Notification()
  4. {
  5. }
  6. void Notification::show(const QString &title, const QString &content)
  7. {
  8. NSUserNotification *userNotification = [[[NSUserNotification alloc] init] autorelease];
  9. userNotification.title = title.toNSString();
  10. userNotification.informativeText = content.toNSString();
  11. NSUserNotificationCenter* center = [NSUserNotificationCenter defaultUserNotificationCenter];
  12. [center deliverNotification:userNotification];
  13. }
  14. void Notification::hideAll()
  15. {
  16. [[NSUserNotificationCenter defaultUserNotificationCenter] removeAllDeliveredNotifications];
  17. }

mac下的“飞秋”大多数只是飞鸽传书协议,而且未发现令人满意的开源项目,所以基于c++与qt实现了基础的飞秋协议。

Contributors (1)