18 Q_PROPERTY(QQuickItem *panel READ panel WRITE setPanel)
19 Q_PROPERTY(QVariant message READ message WRITE setMessage NOTIFY messageChanged)
20 Q_PROPERTY(
int duration READ duration WRITE setDuration NOTIFY durationChanged)
21 Q_PROPERTY(
bool immediateClose READ immediateClose WRITE setImmediateClose)
22 Q_CLASSINFO(
"DefaultProperty",
"panel")
23#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
29 QVariant message()
const;
30 void setMessage(
const QVariant &message);
31 QQuickItem *panel()
const;
32 void setPanel(QQuickItem *panel);
33 QString messageId()
const;
34 void setMessageId(
const QString &msgId);
36 void setDuration(
int duration);
37 bool immediateClose()
const;
38 void setImmediateClose(
bool immediateClose);
44 void messageChanged();
45 void durationChanged();
51 QQuickItem *m_panel =
nullptr;
54 int m_duration = 4000;
55 bool m_immediateClose =
false;
61 Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate)
62 Q_PROPERTY(QQuickItem *layout READ layout WRITE setLayout)
63 Q_PROPERTY(
int capacity READ capacity WRITE setCapacity)
64 Q_PROPERTY(
int count READ count NOTIFY countChanged)
65#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
66 QML_UNCREATABLE(
"MessageManager Attached.")
74 QQuickWindow *window()
const;
75 QQmlComponent *delegate()
const;
76 void setDelegate(QQmlComponent *delegate);
77 QQuickItem *layout()
const;
78 void setLayout(QQuickItem * layout);
80 void setCapacity(
int capacity);
82 QList<FloatingMessageContainer *> messages(
const QString &msgId)
const;
87 bool sendMessage(
const QString &content,
const QString &iconName = QString(),
int duration = 4000,
const QString &msgId = QString());
88 bool sendMessage(QQmlComponent *delegate,
const QVariant &message,
int duration = 4000,
const QString &msgId = QString());
89 void close(DTK_QUICK_NAMESPACE::FloatingMessageContainer *message);
90 void close(
const QString &msgId);
96 virtual void timerEvent(QTimerEvent *e)
override;
100 void ensureDelegate();
101 bool reachedUpperLimit()
const;
103 void stackBeforeMessage(QQuickItem *message);
108 QQmlComponent *m_delegate;
109 QQuickItem *m_layout;
110 QList<QPair<int, FloatingMessageContainer *>> m_timers;