QAbstractListModel adapter over StatusNotifierHost::items().
More...
#include <phosphor-services/include/PhosphorServices/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) |
| |
| PhosphorServices::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()
| PhosphorServices::StatusNotifierItemModel::StatusNotifierItemModel |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
◆ ~StatusNotifierItemModel()
| PhosphorServices::StatusNotifierItemModel::~StatusNotifierItemModel |
( |
| ) |
|
|
override |
◆ activate()
| void PhosphorServices::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 PhosphorServices::StatusNotifierItemModel::contextMenu |
( |
int |
row, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
◆ countChanged
| void PhosphorServices::StatusNotifierItemModel::countChanged |
( |
| ) |
|
|
signal |
◆ data()
| QVariant PhosphorServices::StatusNotifierItemModel::data |
( |
const QModelIndex & |
index, |
|
|
int |
role |
|
) |
| const |
|
override |
◆ host()
◆ hostChanged
| void PhosphorServices::StatusNotifierItemModel::hostChanged |
( |
| ) |
|
|
signal |
◆ itemAt()
◆ roleNames()
| QHash< int, QByteArray > PhosphorServices::StatusNotifierItemModel::roleNames |
( |
| ) |
const |
|
override |
◆ rowCount()
| int PhosphorServices::StatusNotifierItemModel::rowCount |
( |
const QModelIndex & |
parent = {} | ) |
const |
|
override |
◆ scroll()
| void PhosphorServices::StatusNotifierItemModel::scroll |
( |
int |
row, |
|
|
int |
delta, |
|
|
const QString & |
orientation |
|
) |
| |
◆ secondaryActivate()
| void PhosphorServices::StatusNotifierItemModel::secondaryActivate |
( |
int |
row, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
◆ setHost()
The documentation for this class was generated from the following file: