KNotifications
knotification.cpp
435KNotification::event(const QString &eventid, const QString &text, const QPixmap &pixmap, const NotificationFlags &flags, const QString &componentName)
440KNotification *KNotification::event(StandardEvent eventid, const QString &title, const QString &text, const QPixmap &pixmap, const NotificationFlags &flags)
445KNotification *KNotification::event(StandardEvent eventid, const QString &text, const QPixmap &pixmap, const NotificationFlags &flags)
468KNotification *KNotification::event(StandardEvent eventid, const QString &title, const QString &text, const QString &iconName, const NotificationFlags &flags)
473KNotification *KNotification::event(StandardEvent eventid, const QString &title, const QString &text, const NotificationFlags &flags)
475 return event(standardEventToEventId(eventid), title, text, standardEventToIconName(eventid), flags | DefaultEvent);
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
void clearActions()
Removes all actions previously added by addAction() from the notification.
Definition knotification.cpp:194
QWindow * window() const
The window associated with this notification.
Definition knotification.cpp:649
KNotificationReplyAction * replyAction() const
Definition knotification.cpp:252
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
KNotificationAction * defaultAction() const
Definition knotification.cpp:308
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
void setPixmap(const QPixmap &pix)
Set the pixmap that will be shown in the popup.
Definition knotification.cpp:180
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
KNotificationAction * addAction(const QString &label)
Add an action to the notification.
Definition knotification.cpp:208
bool autoDelete
Sets whether this notification object will be automatically deleted after closing.
Definition knotification.h:142
void setUrls(const QList< QUrl > &urls)
Sets URLs associated with this notification.
Definition knotification.cpp:350
void setWindow(QWindow *window)
Sets the window associated with this notification.
Definition knotification.cpp:631
@ CloseOnTimeout
The notification will be automatically closed after a timeout.
Definition knotification.h:161
@ CloseWhenWindowActivated
The notification will be automatically closed if the window() becomes activated.
Definition knotification.h:190
void setReplyAction(std::unique_ptr< KNotificationReplyAction > replyAction)
Add an inline reply action to the notification.
Definition knotification.cpp:257
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
KNotificationAction * addDefaultAction(const QString &label)
Add a default action that will be triggered when the notification is activated (typically,...
Definition knotification.cpp:270
void setText(const QString &text)
Set the notification text that will appear in the popup.
Definition knotification.cpp:142
applicationName
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void deleteLater()
bool disconnect(const QMetaObject::Connection &connection)
QString number(double n, char format, int precision)
singleShot
void timeout()
QList< QUrl > fromStringList(const QStringList &urls, ParsingMode mode)
QStringList toStringList(const QList< QUrl > &urls, FormattingOptions options)
void activeChanged()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:24 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:57:24 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.