KNotifications
knotification.h
127 Q_PROPERTY(QString componentName READ componentName WRITE setComponentName NOTIFY componentNameChanged)
244 explicit KNotification(const QString &eventId, NotificationFlags flags = CloseOnTimeout, QObject *parent = nullptr);
314 * Set the pixmap that will be shown in the popup. If you want to use an icon from the icon theme use setIconName instead.
383 * auto replyAction = std::make_unique<KNotificationReplyAction>(i18nc("@action:button", "Reply"));
385 * QObject::connect(replyAction.get(), &KNotificationReplyAction::replied, [](const QString &text) {
601 * Adds a custom hint to the notification. Those are key-value pairs that can be interpreted by the respective notification backend to trigger additional,
699 * @param componentName used to determine the location of the config file. by default, appname is used
720 * @param componentName used to determine the location of the config file. by default, plasma_workspace is used
741 event(StandardEvent eventId, const QString &text = QString(), const QPixmap &pixmap = QPixmap(), const NotificationFlags &flags = CloseOnTimeout);
758 event(StandardEvent eventId, const QString &title, const QString &text, const QPixmap &pixmap, const NotificationFlags &flags = CloseOnTimeout);
772 * @param componentName used to determine the location of the config file. by default, plasma_workspace is used
797 event(StandardEvent eventId, const QString &title, const QString &text, const QString &iconName, const NotificationFlags &flags = CloseOnTimeout);
812 static KNotification *event(StandardEvent eventId, const QString &title, const QString &text, const NotificationFlags &flags = CloseOnTimeout);
void setLabel(const QString &label)
Set the user-facing label for the action.
Definition knotification.cpp:63
KNotification is the main class for creating notifications.
Definition knotification.h:96
QFlags< NotificationFlag > NotificationFlags
Stores a combination of NotificationFlag values.
Definition knotification.h:203
void setTitle(const QString &title)
Set the title of the notification popup.
Definition knotification.cpp:128
void setEventId(const QString &eventId)
Set the event id, if not already passed to the constructor.
Definition knotification.cpp:110
KNotification(const QString &eventId, NotificationFlags flags=CloseOnTimeout, QObject *parent=nullptr)
Create a new notification.
Definition knotification.cpp:81
void setAutoDelete(bool autoDelete)
Sets whether this notification object will be automatically deleted after closing.
Definition knotification.cpp:536
static KNotification * event(const QString &eventId, const QString &title, const QString &text, const QPixmap &pixmap=QPixmap(), const NotificationFlags &flags=CloseOnTimeout, const QString &componentName=QString())
emit an event
Definition knotification.cpp:416
static void beep(const QString &reason=QString())
This is a simple substitution for QApplication::beep()
Definition knotification.cpp:492
void setFlags(const NotificationFlags &flags)
Set the notification flags.
Definition knotification.cpp:318
QString eventId
Set the event id, if not already passed to the constructor.
Definition knotification.h:102
Q_INVOKABLE void setHint(const QString &hint, const QVariant &value)
Definition knotification.cpp:593
void setIconName(const QString &icon)
Set the icon that will be shown in the popup.
Definition knotification.cpp:156
void setComponentName(const QString &componentName)
The componentData is used to determine the location of the config file.
Definition knotification.cpp:337
bool isAutoDelete() const
Returns whether this notification object will be automatically deleted after closing.
Definition knotification.cpp:531
bool autoDelete
Sets whether this notification object will be automatically deleted after closing.
Definition knotification.h:142
void xdgActivationTokenChanged()
Emitted when xdgActivationToken changes.
void setUrls(const QList< QUrl > &urls)
Sets URLs associated with this notification.
Definition knotification.cpp:350
@ CloseOnTimeout
The notification will be automatically closed after a timeout.
Definition knotification.h:161
@ Persistent
The notification will NOT be automatically closed after a timeout.
Definition knotification.h:168
@ SkipGrouping
Sends a hint to Plasma to skip grouping for this notification.
Definition knotification.h:180
@ CloseWhenWindowActivated
The notification will be automatically closed if the window() becomes activated.
Definition knotification.h:190
@ LoopSound
The audio plugin will loop the sound until the notification is closed.
Definition knotification.h:173
QString componentName
The componentData is used to determine the location of the config file.
Definition knotification.h:127
void setUrgency(Urgency urgency)
Sets the urgency of the notification.
Definition knotification.cpp:361
void setText(const QString &text)
Set the notification text that will appear in the popup.
Definition knotification.cpp:142
QObject(QObject *parent)
Q_ENUM(...)
Q_FLAG(...)
Q_INVOKABLEQ_INVOKABLE
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
virtual bool event(QEvent *e)
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:48:29 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:48:29 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.