On this page

NotificationManager QML Type

The notification model, which handles freedesktop.org compliant notification requests. More...

Import Statement: import QtApplicationManager.SystemUI

Properties

Signals

Methods

Detailed Description

The NotificationManager singleton type provides a QML API only.

The type is derived from QAbstractListModel and can be directly used as a model in notification views.

Each item in this model corresponds to an active notification.

Applications create individual notifications via the Notification type; NotificationManager is the System-UI-side aggregator and model for all of them.

NotificationManager Limits

To protect the System UI from flooding (whether accidental - an app stuck in a notification loop - or adversarial), the NotificationManager enforces two caps on the number of simultaneously active notifications:

  • Per-application cap: at most 50 notifications per application id. Once this is reached, further notification requests from that application are rejected with a warning in the log.
  • Global cap: at most 500 active notifications across all sources. When the global cap is reached and a new notification is requested, the oldest non-sticky notification is evicted to make room. Sticky notifications (those with timeout set to 0) are protected from eviction. If the global cap is reached and all active notifications are sticky, the new request is rejected.

The per-application cap is tied to the applicationId. Notifications from different sources therefore cannot crowd each other out.

These limits match the behavior of major mobile platforms.

NotificationManager Roles

The following roles are available in this model - also take a look at the freedesktop.org specification for an in-depth explanation of these fields and how clients should populate them:

Role nameTypeDescription
idintThe unique id of this notification.
applicationIdstringThe id of the application that created this notification. This can be used to look up information about the application in the ApplicationManager model.

Note: The applicationId role is neither unique within this model, nor is it guaranteed to be valid. A single application can have multiple active notifications, and on the other hand, system-notifications have no application context at all.

Note: Notifications coming in via the external org.freedesktop.Notifications D-Bus interface carry an applicationId that is prefixed with :ext:. It is supplied by the client itself and as such cannot be trusted.

priorityintSee the client side documentation of Notification::priority
summarystringSee the client side documentation of Notification::summary
bodystringSee the client side documentation of Notification::body
categorystringSee the client side documentation of Notification::category
iconurlSee the client side documentation of Notification::icon
imageurlSee the client side documentation of Notification::image
actionsobjectSee the client side documentation of Notification::actions. This is a list where each item is a single property (the key is the actionId and the value the actionText). Easier access is provided with the actionList role below.
actionListobjectSee the client side documentation of Notification::actions. In contrast to the actions object above actions are provided as a list with actionId and actionText properties
showActionsAsIconsboolSee the client side documentation of Notification::showActionsAsIcons
dismissOnActionboolSee the client side documentation of Notification::dismissOnAction
isAcknowledgeableboolSee the client side documentation of Notification::acknowledgeable For backwards compatibility, isClickable can also be used to refer to this role.
isSystemNotificationboolHolds true for notifications coming in via the external org.freedesktop.Notifications D-Bus interface and false for notifications coming from integrated applications or the System UI.
isShowingProgressboolSee the client side documentation of Notification::showProgress
progressqrealSee the client side documentation of Notification::progress
isStickyboolSee the client side documentation of Notification::sticky
timeoutintSee the client side documentation of Notification::timeout
extendedobjectSee the client side documentation of Notification::extended
createddateThe timestamp denoting when the notification was created
updateddateThe timestamp denoting when the notification was last modififed

The actual backend implementation that is receiving the notifications from other process is fully compliant to the D-Bus interface of the freedesktop.org specification for notifications.

For testing purposes, the notify-send tool from the libnotify package can be used to create notifications.

See also Notification.

Property Documentation

count : int [read-only]

This property holds the number of active notifications in the model.

Signal Documentation

notificationAboutToBeRemoved(uint id)

This signal is emitted before an existing notification, identified by id, is removed from the model.

Note: In addition to the normal "low-level" QAbstractListModel signals, the application manager will also emit these "high-level" signals for System UIs that cannot work directly on the NotificationManager model: notificationAdded, notificationAboutToBeRemoved and notificationChanged.

Note: The corresponding handler is onNotificationAboutToBeRemoved.

notificationAdded(uint id)

This signal is emitted after a new notification, identified by id, has been added. The model has already been update before this signal is sent out.

Note: In addition to the normal "low-level" QAbstractListModel signals, the application manager will also emit these "high-level" signals for System UIs that cannot work directly on the NotificationManager model: notificationAdded, notificationAboutToBeRemoved and notificationChanged.

Note: The corresponding handler is onNotificationAdded.

notificationChanged(uint id, list<string> changedRoles)

Emitted whenever one or more data roles, denoted by changedRoles, changed on the notification identified by id. An empty list in the changedRoles argument means that all roles should be considered modified.

Note: In addition to the normal "low-level" QAbstractListModel signals, the application manager will also emit these "high-level" signals for System UIs that cannot work directly on the NotificationManager model: notificationAdded, notificationAboutToBeRemoved and notificationChanged.

Note: The corresponding handler is onNotificationChanged.

Method Documentation

void acknowledgeNotification(int id)

This function needs to be called by the System UI when the user acknowledged the notification identified by id (most likely by clicking on it).

void dismissNotification(int id)

This function needs to be called by the System UI when the notification identified by id is no longer needed.

The creator of the notification will be notified about this dismissal.

object get(int index)

Retrieves the model data at index as a JavaScript object. See the role names for the expected object fields.

Returns an empty object if the specified index is invalid.

int indexOfNotification(int id)

Maps the notification id to its position within the model.

Returns -1 if the specified id is invalid.

object notification(int id)

Retrieves the model data for the notification identified by id as a JavaScript object. See the role names for the expected object fields.

Returns an empty object if the specified id is invalid.

void triggerNotificationAction(int id, string actionId)

This function needs to be called by the System UI when the user triggered a notification action. Unless the notification is made resident (dismissOnAction is false), the notification will also be dismissed.

The notification is identified by id and the action by actionId.

Note: You should only use action-ids that have been set for the the given notification (see the actions role). However, the application manager will accept and forward any arbitrary string. Be aware that this string is broadcast on the session D-Bus when running in multi-process mode.

See also dismissNotification().

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.