CCIMXDesktop
 
Loading...
Searching...
No Matches
desktoptoast.h
1#ifndef DESKTOPTOAST_H
2#define DESKTOPTOAST_H
3#include <QMutex>
4#include <QPointer>
5#include <QQueue>
6#include <QWidget>
8class QPropertyAnimation;
9
15class DesktopToast : public QWidget {
16 Q_OBJECT
17public:
23 explicit DesktopToast(QWidget* parent = nullptr);
32 void set_message(const QString& message);
37 void setWidth(const int width);
38signals:
45 void do_show_toast(QString msg);
46
47private:
52 void adjust_place();
56 void start_animation();
60 void start_close_animation();
65 void set_message_impl(const QString& message);
66
67 // QLabel* label; ///< the label to display the message
68 InformToastLabel* label;
69 QPoint startPos, endPos;
70 int animation_maintain_msec { 500 };
71 int wait_time { 1000 };
79 QPointer<QPropertyAnimation> moveAnimation { nullptr };
87 QPointer<QPropertyAnimation> fadeAnimation { nullptr };
88
93 QAtomicInteger<bool> isHandling { false };
102 QQueue<QString> pools;
103 QMutex queue_mutex;
104 int _width = 1024 * 0.9;
105};
106
107#endif // DESKTOPTOAST_H
The DesktopToast class is the toast handle classes using less lock messages queue to display the mess...
Definition DesktopToast.h:15
DesktopToast(QWidget *parent=nullptr)
Construct a new Desktop Toast object.
void do_show_toast(QString msg)
do_show_toast the signal to show the toast
void set_message(const QString &message)
set_message push the toast display into the toast display sessions
void setWidth(const int width)
setWidth
Definition desktoptoast.cpp:85
A custom QWidget designed to display an informative toast notification.
Definition InformToastLabel.h:25