Skip to content

NotificationCenter

In-app notification drawer with grouping (2.27 / 2.63 / 2.70).

import QWinUI3.Extras · src/extras/QWinUI3/Extras/NotificationCenter.qml

Category: Status & feedback · Library: v3.56

← Component index

Gallery: Notification center — src/gallery/pages/NotificationCenterPage.qml

Python: same QML type after qwinui3.setup_engine() — Python API.

Extends Control.

Example

NotificationCenter {
    id: center
    model: notifications
    maxHistory: 100
    persistCategory: "MyAppNotify"
    groupingPolicy: "category"  // category | severity | none
    onNotificationClicked: (index, item) => { … }
}
center.addNotification({
    id: "build-42",
    title: qsTr("Build finished"),
    message: qsTr("Release 2.63 succeeded."),
    category: qsTr("CI"),
    severity: center.success
})
center.open()

// --- API ---
// properties: model, groupRole, isOpen, unreadCount, count, maxHistory, dedupeIdRole
// methods: open(), close(), markRead(i), markUnread(i), markAllRead(), removeAt(i),
//          indexForId(id), exportHistory(), importHistory(json),
//          clear(), clearRead(), addNotification(item), push(item)
// signals: notificationClicked, notificationActionClicked, cleared

Notes

Experimental — dismissible history + category groups (FL-007). Complements ToastHost (transient) and InfoBarHost (inline). Pair with NotificationBridge recordInCenter (2.63). Not an OS notification center. See docs/notification-center-263.md.

API

Properties

Name Type Description
model var —
groupRole string —
dedupeIdRole string —
maxHistory int —
groupingPolicy string Grouping: "category" (default) | "severity" | "none" (2.70 D7)
persistCategory string Persist model + read flags under this Settings category (empty = memory only)
edge alias —
drawerWidth alias —
informational int —
success int —
warning int —
error int —
attention int —
isOpen bool —
unreadCount int —
groupedModel var —
count int —

Signals

Signature Description
notificationClicked(int index, var item) —
notificationActionClicked(int index, var item) —
cleared() —

Methods

Signature Description
open() —
close() —
markRead(index) —
markUnread(index) —
removeAt(index) —
indexForId(id) —
exportHistory() —
importHistory(json) —
markAllRead() —
clear() —
clearRead() —
addNotification(item) —
savePersisted() —
loadPersisted() —
push(item) —

Inherited from Control

Also available (base type / Qt Quick Controls):

  • padding
  • font
  • background / contentItem

Generated from module sources by scripts/generate_component_docs.py — do not edit by hand.