QAbstractListModel adapter over StatusNotifierHost::items().
More...
#include <PhosphorServiceSni/StatusNotifierItemModel.h>
|
| enum | Roles {
IdRole = Qt::UserRole + 1
, TitleRole
, CategoryRole
, StatusRole
,
IconUrlRole
, OverlayIconUrlRole
, AttentionIconUrlRole
, IconImageRole
,
OverlayIconImageRole
, AttentionIconImageRole
, ToolTipTitleRole
, ToolTipBodyRole
,
MenuPathRole
, ItemIsMenuRole
, DBusServiceRole
, DBusPathRole
,
ItemObjectRole
} |
|
| | StatusNotifierItemModel (QObject *parent=nullptr) |
| | ~StatusNotifierItemModel () override |
| StatusNotifierHost * | host () const |
| void | setHost (StatusNotifierHost *host) |
| int | rowCount (const QModelIndex &parent={}) const override |
| QVariant | data (const QModelIndex &index, int role) const override |
| QHash< int, QByteArray > | roleNames () const override |
| void | activate (int row, int x, int y) |
| | QML-friendly action invocations: looks up the item by row and dispatches.
|
| void | secondaryActivate (int row, int x, int y) |
| void | contextMenu (int row, int x, int y) |
| void | scroll (int row, int delta, const QString &orientation) |
| PhosphorServiceSni::StatusNotifierItem * | itemAt (int row) const |
QAbstractListModel adapter over StatusNotifierHost::items().
Hand this to a QML Repeater / ListView. The roles cover everything a typical tray delegate needs without exposing the raw item QObject (kept available via ItemObjectRole for invoking action methods).
◆ Roles
| Enumerator |
|---|
| IdRole | |
| TitleRole | |
| CategoryRole | |
| StatusRole | |
| IconUrlRole | |
| OverlayIconUrlRole | |
| AttentionIconUrlRole | |
| IconImageRole | |
| OverlayIconImageRole | |
| AttentionIconImageRole | |
| ToolTipTitleRole | |
| ToolTipBodyRole | |
| MenuPathRole | |
| ItemIsMenuRole | |
| DBusServiceRole | |
| DBusPathRole | |
| ItemObjectRole | the raw StatusNotifierItem* for Q_INVOKABLE methods
|
◆ StatusNotifierItemModel()
| PhosphorServiceSni::StatusNotifierItemModel::StatusNotifierItemModel |
( |
QObject * | parent = nullptr | ) |
|
|
explicit |
◆ ~StatusNotifierItemModel()
| PhosphorServiceSni::StatusNotifierItemModel::~StatusNotifierItemModel |
( |
| ) |
|
|
override |
◆ activate()
| void PhosphorServiceSni::StatusNotifierItemModel::activate |
( |
int | row, |
|
|
int | x, |
|
|
int | y ) |
QML-friendly action invocations: looks up the item by row and dispatches.
coords are in screen-logical pixels; the item's process uses them to position any popup it wants to render (some menus position relative to these).
◆ contextMenu()
| void PhosphorServiceSni::StatusNotifierItemModel::contextMenu |
( |
int | row, |
|
|
int | x, |
|
|
int | y ) |
◆ countChanged
| void PhosphorServiceSni::StatusNotifierItemModel::countChanged |
( |
| ) |
|
|
signal |
◆ data()
| QVariant PhosphorServiceSni::StatusNotifierItemModel::data |
( |
const QModelIndex & | index, |
|
|
int | role ) const |
|
nodiscardoverride |
◆ host()
◆ hostChanged
| void PhosphorServiceSni::StatusNotifierItemModel::hostChanged |
( |
| ) |
|
|
signal |
◆ itemAt()
◆ roleNames()
| QHash< int, QByteArray > PhosphorServiceSni::StatusNotifierItemModel::roleNames |
( |
| ) |
const |
|
nodiscardoverride |
◆ rowCount()
| int PhosphorServiceSni::StatusNotifierItemModel::rowCount |
( |
const QModelIndex & | parent = {} | ) |
const |
|
nodiscardoverride |
◆ scroll()
| void PhosphorServiceSni::StatusNotifierItemModel::scroll |
( |
int | row, |
|
|
int | delta, |
|
|
const QString & | orientation ) |
◆ secondaryActivate()
| void PhosphorServiceSni::StatusNotifierItemModel::secondaryActivate |
( |
int | row, |
|
|
int | x, |
|
|
int | y ) |
◆ setHost()
The documentation for this class was generated from the following file: