mirror of
https://github.com/ysoftdevs/Testa.git
synced 2026-01-11 14:20:23 +01:00
20 lines
458 B
C++
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;
|
|
}
|