Files
Testa/notification.cpp

20 lines
458 B
C++

#include <QSystemTrayIcon>
#include "notification.h"
static QSystemTrayIcon* sharedSystemTrayIcon;
void Notification::show(const QString &title, const QString &message)
{
if (sharedSystemTrayIcon == nullptr)
sharedSystemTrayIcon = new QSystemTrayIcon();
sharedSystemTrayIcon->show();
sharedSystemTrayIcon->showMessage(title, message);
}
void Notification::hide()
{
sharedSystemTrayIcon->hide();
delete sharedSystemTrayIcon;
}