List model over a NotificationServer's live notifications. More...
#include <PhosphorServiceNotifications/NotificationModel.h>
Public Types | |
| enum | Roles { NotificationRole = Qt::UserRole + 1 , IdRole , AppNameRole , AppIconRole , SummaryRole , BodyRole , ActionsRole , UrgencyRole , CategoryRole , DesktopEntryRole , ImageRole , HasImageRole , ResidentRole , TransientRole , SuppressSoundRole , ValueRole , ExpireTimeoutRole , TimestampRole } |
Signals | |
| void | serverChanged () |
| void | countChanged () |
Public Member Functions | |
| NotificationModel (QObject *parent=nullptr) | |
| ~NotificationModel () override | |
| NotificationServer * | server () const |
| void | setServer (NotificationServer *server) |
| int | rowCount (const QModelIndex &parent={}) const override |
| QVariant | data (const QModelIndex &index, int role) const override |
| QHash< int, QByteArray > | roleNames () const override |
List model over a NotificationServer's live notifications.
Bind server, then drive a ListView / Repeater off the rows. Rows are kept in ascending-id order (the same order the server vends): a new notification is inserted at its id-sorted position, a replaces_id update mutates the row in place and forwards as dataChanged, and a close removes the row. The model does NOT own the notifications; the server does.
|
explicit |
|
override |
|
signal |
|
nodiscardoverride |
|
nodiscardoverride |
|
nodiscardoverride |
|
nodiscard |
|
signal |
| void PhosphorServiceNotifications::NotificationModel::setServer | ( | NotificationServer * | server | ) |