KActivities 5.109.0
|
Data model that shows existing activities. More...
#include <activitiesmodel.h>
Public Types | |
enum | Roles { ActivityId = Qt::UserRole , ActivityName = Qt::UserRole + 1 , ActivityDescription = Qt::UserRole + 2 , ActivityIconSource = Qt::UserRole + 3 , ActivityState = Qt::UserRole + 4 , ActivityBackground = Qt::UserRole + 5 , ActivityIsCurrent = Qt::UserRole + 6 , UserRole = Qt::UserRole + 32 } |
Properties | |
QVector< Info::State > | shownStates |
Signals | |
void | shownStatesChanged (const QVector< Info::State > &state) |
Public Slots | |
void | setShownStates (const QVector< Info::State > &shownStates) |
The model can filter the list of activities based on their state. | |
QVector< Info::State > | shownStates () const |
The model can filter the list of activities based on their state. | |
Public Member Functions | |
ActivitiesModel (QObject *parent=nullptr) | |
ActivitiesModel (QVector< Info::State > shownStates, QObject *parent=nullptr) | |
Constructs the model and sets the shownStates. | |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
QHash< int, QByteArray > | roleNames () const override |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
Data model that shows existing activities.
Enumerator | |
---|---|
ActivityId | UUID of the activity. |
ActivityName | Activity name. |
ActivityDescription | Activity description. |
ActivityIconSource | Activity icon source name. |
ActivityState | The current state of the activity.
|
ActivityBackground | Activity wallpaper (currently unsupported) |
ActivityIsCurrent | Is this activity the current one current. |
UserRole | To be used by models that inherit this one. |
KActivities::ActivitiesModel::ActivitiesModel | ( | QVector< Info::State > | shownStates, |
QObject * | parent = nullptr |
||
) |
Constructs the model and sets the shownStates.
|
slot |
The model can filter the list of activities based on their state.
This method sets which states should be shown.
|
slot |
The model can filter the list of activities based on their state.
This method returns which states are currently shown.