How to set Alerts in MAC system
-
Hi,
Mac has Banners, Alerts, and Badges (https://support.apple.com/en-il/HT204079)
How can I use this tool from the QT?Thx
-
Hi,
Mac has Banners, Alerts, and Badges (https://support.apple.com/en-il/HT204079)
How can I use this tool from the QT?Thx
@borisa
not directly, but it can be easily mimed (platform independently) with QWidgets:QFrame* notifier = new QFrame; notifier ->setWindowFlags( Qt::Tool | Qt::CustomizeWindowHint | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint ); notifier ->setFocusPolicy( Qt::NoFocus ); const QRect availableGeometry = QGuiApplication::primaryScreen()->availableGeometry(); // Qt5 way; for Qt4 use QDesktopWidget::availableGeometry(notifier); QRect geom = notifier ->geometry(); geom.moveBottomRight( availableGeometry.bottomRight() - QPoint(20,20) ); notifier ->setGeometry( geom ); notifier ->show();
For a nicer effect you can additionally use QGraphicsOpacityEffect to fade the widget in and out.
-
Hi,
IIRC messages can be sent using QSystemTrayIcon
Badges can be set using QtMac::setBadgeLabelText
I don't remember if there's something for the banner however you can use Objective-C++ for that without any problem.
-
What relevant header file do you mean ?
Take a look e.g. at the QtMacExtras module there are several examples there.