13#include <QGraphicsOpacityEffect>
16#include <QPropertyAnimation>
45 QLabel* iconLabel_ =
nullptr;
46 QLabel* messageLabel_ =
nullptr;
47 QPushButton* closeBtn_ =
nullptr;
48 QTimer* autoCloseTimer_ =
nullptr;
49 QGraphicsOpacityEffect* opacityEffect_ =
nullptr;
50 bool closing_ =
false;
68 bool eventFilter(QObject* obj, QEvent* event)
override;
71 void repositionToasts();
74 QList<ToastWidget*> activeToasts_;
75 static constexpr int kMaxToasts = 5;
76 static constexpr int kToastWidth = 380;
77 static constexpr int kSpacing = 8;
78 static constexpr int kMarginRight = 16;
79 static constexpr int kMarginBottom = 16;
98 void info(
const std::string& message,
float duration = 3.0f)
override;
99 void success(
const std::string& message,
float duration = 3.0f)
override;
100 void warning(
const std::string& message,
float duration = 5.0f)
override;
101 void error(
const std::string& message,
float duration = 5.0f)
override;
109 void processNotification(
const QString& message,
int type,
float duration);
112 QWidget* parentWidget_ =
nullptr;
void info(const std::string &message, float duration=3.0f) override
Show an info notification.
void error(const std::string &message, float duration=5.0f) override
Show an error notification.
void clearAll() override
Clear all notifications.
QtNotificationService(QObject *parent=nullptr, ThemeManager *themeManager=nullptr)
void warning(const std::string &message, float duration=5.0f) override
Show a warning notification.
void setParentWidget(QWidget *widget)
~QtNotificationService() override
void success(const std::string &message, float duration=3.0f) override
Show a success notification.
void notificationReceived(const QString &message, int type, float duration)
void show(const core::Notification ¬ification) override
Show a notification with full control.
void addToast(const QString &message, core::NotificationType type, float duration)
bool eventFilter(QObject *obj, QEvent *event) override
ToastContainer(QWidget *parent, ThemeManager *themeManager=nullptr)