KNotifications
knotification.cpp
41 KNotification::KNotification(const QString &eventId, QWidget *parent, const NotificationFlags &flags)
61 KNotification::KNotification(const QString &eventId, const NotificationFlags &flags, QObject *parent)
443 KNotification::event(StandardEvent eventid, const QString &title, const QString &text, const QPixmap &pixmap, QWidget *widget, const NotificationFlags &flags)
445 return event(standardEventToEventId(eventid), title, text, pixmap, widget, flags | DefaultEvent);
448 KNotification *KNotification::event(StandardEvent eventid, const QString &text, const QPixmap &pixmap, QWidget *widget, const NotificationFlags &flags)
474 KNotification::event(StandardEvent eventid, const QString &title, const QString &text, const QString &iconName, QWidget *widget, const NotificationFlags &flags)
476 return event(standardEventToEventId(eventid), title, text, iconName, widget, flags | DefaultEvent);
479 KNotification *KNotification::event(StandardEvent eventid, const QString &title, const QString &text, QWidget *widget, const NotificationFlags &flags)
void setEventId(const QString &eventId)
Set the event id, if not already passed to the constructor.
Definition: knotification.cpp:91
static Q_INVOKABLE void activateWindow(QWindow *window, long time=0)
@ CloseWhenWidgetActivated
The notification will be automatically closed if the widget() becomes activated.
Definition: knotification.h:156
void setDefaultAction(const QString &defaultAction)
Set a default action that will be triggered when the notification is activated (typically,...
Definition: knotification.cpp:223
void setFlags(const NotificationFlags &flags)
Set the notification flags.
Definition: knotification.cpp:267
void action3Activated()
This is an overloaded member function, provided for convenience. It differs from the above function o...
static Q_INVOKABLE void setCurrentXdgActivationToken(const QString &token)
bool isAutoDelete() const
Returns whether this notification object will be automatically deleted after closing.
Definition: knotification.cpp:537
KNotificationReplyAction * replyAction() const
Definition: knotification.cpp:205
WindowActivate
void setPixmap(const QPixmap &pix)
Set the pixmap that will be shown in the popup.
Definition: knotification.cpp:177
QStringList toStringList(const QList< QUrl > &urls, QUrl::FormattingOptions options)
Q_EMITQ_EMIT
static bool isPlatformWayland()
void setContexts(const ContextList &contexts)
set the list of contexts, see KNotification::Context
Definition: knotification.cpp:247
QString componentName
The componentData is used to determine the location of the config file.
Definition: knotification.h:74
singleShot
void action2Activated()
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setReplyAction(std::unique_ptr< KNotificationReplyAction > replyAction)
Add an inline reply action to the notification.
Definition: knotification.cpp:210
void setComponentName(const QString &componentName)
The componentData is used to determine the location of the config file.
Definition: knotification.cpp:286
void setUrgency(Urgency urgency)
Sets the urgency of the notification.
Definition: knotification.cpp:310
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QList< QUrl > fromStringList(const QStringList &urls, QUrl::ParsingMode mode)
void deleteLater()
KNotification(const QString &eventId, QWidget *widget, const NotificationFlags &flags=CloseOnTimeout)
Create a new notification.
Definition: knotification.cpp:41
@ CloseOnTimeout
The notification will be automatically closed after a timeout.
Definition: knotification.h:137
void installEventFilter(QObject *filterObj)
void timeout()
desktopFileName
void setUrls(const QList< QUrl > &urls)
Sets URLs associated with this notification.
Definition: knotification.cpp:299
void activate(unsigned int action=0)
Activate the action specified action If the action is zero, then the default action is activated.
Definition: knotification.cpp:324
bool isTopLevel() const const
static void beep(const QString &reason=QString(), QWidget *widget=nullptr)
This is a simple substitution for QApplication::beep()
Definition: knotification.cpp:498
void setIconName(const QString &icon)
Set the icon that will be shown in the popup.
Definition: knotification.cpp:153
applicationName
Definition: knotification.h:32
void raise()
void setText(const QString &text)
Set the notification text that will appear in the popup.
Definition: knotification.cpp:139
WId winId() const const
QString defaultAction
Set a default action that will be triggered when the notification is activated (typically,...
Definition: knotification.h:59
bool eventFilter(QObject *watched, QEvent *event) override
reimplemented for internal reasons
Definition: knotification.cpp:557
Q_INVOKABLE void setHint(const QString &hint, const QVariant &value)
Definition: knotification.cpp:614
void ref()
The notification will automatically be closed if all presentations are finished.
Definition: knotification.cpp:484
QWidget * parentWidget() const const
void defaultActivated()
Emitted when the default action has been activated.
void action1Activated()
Convenience signal that is emitted when the first action is activated.
QObject * parent() const const
void setActions(const QStringList &actions)
Set the list of actions shown in the popup.
Definition: knotification.cpp:191
void setAutoDelete(bool autoDelete)
Sets whether this notification object will be automatically deleted after closing.
Definition: knotification.cpp:542
static KNotification * event(const QString &eventId, const QString &title, const QString &text, const QPixmap &pixmap=QPixmap(), QWidget *widget=nullptr, const NotificationFlags &flags=CloseOnTimeout, const QString &componentName=QString())
emit an event
Definition: knotification.cpp:412
void setTitle(const QString &title)
Set the title of the notification popup.
Definition: knotification.cpp:125
QString eventId
Set the event id, if not already passed to the constructor.
Definition: knotification.h:39
bool autoDelete
Sets whether this notification object will be automatically deleted after closing.
Definition: knotification.h:89
void setWidget(QWidget *widget)
Set the widget associated to the notification.
Definition: knotification.cpp:114
void addContext(const Context &context)
append a context at the list of contexts, see KNotification::Context
Definition: knotification.cpp:252
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Oct 1 2023 03:54:49 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Oct 1 2023 03:54:49 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.