7#ifndef ACTIVITIES_ACTIVITIESMODEL_H
8#define ACTIVITIES_ACTIVITIESMODEL_H
11#include <QAbstractListModel>
21class QDBusPendingCallWatcher;
25class ActivitiesModelPrivate;
34 Q_PROPERTY(QVector<Info::State> shownStates READ shownStates WRITE setShownStates NOTIFY shownStatesChanged)
45 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
47 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const override;
49 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole)
const override;
51 QHash<int, QByteArray> roleNames()
const override;
54 ActivityId = Qt::UserRole,
55 ActivityName = Qt::UserRole + 1,
56 ActivityDescription = Qt::UserRole + 2,
57 ActivityIconSource = Qt::UserRole + 3,
58 ActivityState = Qt::UserRole + 4,
59 ActivityBackground = Qt::UserRole + 5,
60 ActivityIsCurrent = Qt::UserRole + 6,
62 UserRole = Qt::UserRole + 32,
79 void shownStatesChanged(
const QVector<Info::State> &state);
82 friend class ActivitiesModelPrivate;
83 ActivitiesModelPrivate *
const d;
Data model that shows existing activities.
Definition activitiesmodel.h:31
ActivitiesModel(QVector< Info::State > shownStates, QObject *parent=nullptr)
Constructs the model and sets the shownStates.
QVector< Info::State > shownStates() const
The model can filter the list of activities based on their state.
void setShownStates(const QVector< Info::State > &shownStates)
The model can filter the list of activities based on their state.
Roles
Definition activitiesmodel.h:53
Namespace for everything in libkactivities.
Definition consumer.h:20