7#include "taskgroupingproxymodel.h"
8#include "abstracttasksmodel.h"
19 Private(TaskGroupingProxyModel *q);
22 AbstractTasksModelIface *abstractTasksSourceModel =
nullptr;
24 TasksModel::GroupMode groupMode = TasksModel::GroupApplications;
25 bool groupDemandingAttention =
false;
26 int windowTasksThreshold = -1;
28 QList<QList<int> *> rowMap;
30 QSet<QString> blacklistedAppIds;
31 QSet<QString> blacklistedLauncherUrls;
33 bool isGroup(
int row);
34 bool any(
const QModelIndex &parent,
int role);
35 bool all(
const QModelIndex &parent,
int role);
37 void sourceRowsAboutToBeInserted(
const QModelIndex &parent,
int first,
int last);
38 void sourceRowsInserted(
const QModelIndex &parent,
int start,
int end);
39 void sourceRowsAboutToBeRemoved(
const QModelIndex &parent,
int first,
int last);
40 void sourceRowsRemoved(
const QModelIndex &parent,
int start,
int end);
41 void sourceModelAboutToBeReset();
42 void sourceModelReset();
43 void sourceDataChanged(QModelIndex topLeft, QModelIndex bottomRight,
const QList<int> &roles = QList<int>());
44 void adjustMap(
int anchor,
int delta);
47 bool shouldGroupTasks();
48 void checkGrouping(
bool silent =
false);
49 bool isBlacklisted(
const QModelIndex &sourceIndex);
50 bool tryToGroup(
const QModelIndex &sourceIndex,
bool silent =
false);
51 void formGroupFor(
const QModelIndex &index);
52 void breakGroupFor(
const QModelIndex &index,
bool silent =
false);
55 TaskGroupingProxyModel *
const q;
63TaskGroupingProxyModel::Private::~Private()
68bool TaskGroupingProxyModel::Private::isGroup(
int row)
70 if (row < 0 || row >= rowMap.
count()) {
74 return (rowMap.
at(row)->count() > 1);
77bool TaskGroupingProxyModel::Private::any(
const QModelIndex &parent,
int role)
81 for (
int i = 0; i < q->rowCount(parent); ++i) {
82 if (q->index(i, 0, parent).data(role).toBool()) {
90bool TaskGroupingProxyModel::Private::all(
const QModelIndex &parent,
int role)
94 for (
int i = 0; i < q->rowCount(parent); ++i) {
95 if (!q->index(i, 0, parent).data(role).toBool()) {
103void TaskGroupingProxyModel::Private::sourceRowsAboutToBeInserted(
const QModelIndex &parent,
int first,
int last)
110void TaskGroupingProxyModel::Private::sourceRowsInserted(
const QModelIndex &parent,
int start,
int end)
119 bool shouldGroup = shouldGroupTasks();
121 for (
int i =
start; i <=
end; ++i) {
122 if (!shouldGroup || !tryToGroup(q->sourceModel()->index(i, 0))) {
132void TaskGroupingProxyModel::Private::sourceRowsAboutToBeRemoved(
const QModelIndex &parent,
int first,
int last)
139 for (
int i = first; i <= last; ++i) {
140 for (
int j = 0; j < rowMap.
count(); ++j) {
142 const int mapIndex = sourceRows->
indexOf(i);
144 if (mapIndex != -1) {
146 if (sourceRows->
count() == 1) {
151 }
else if (sourceRows->
count() == 2) {
153 q->beginRemoveRows(parent, 0, 1);
154 rowMap[j]->
remove(mapIndex);
158 Q_EMIT q->dataChanged(parent, parent);
162 q->beginRemoveRows(parent, mapIndex, mapIndex);
163 rowMap[j]->
remove(mapIndex);
168 Q_EMIT q->dataChanged(parent, parent);
177void TaskGroupingProxyModel::Private::sourceRowsRemoved(
const QModelIndex &parent,
int start,
int end)
189void TaskGroupingProxyModel::Private::sourceModelAboutToBeReset()
191 q->beginResetModel();
194void TaskGroupingProxyModel::Private::sourceModelReset()
203 for (
int i = topLeft.
row(); i <= bottomRight.
row(); ++i) {
204 const QModelIndex &sourceIndex = q->sourceModel()->index(i, 0);
205 QModelIndex proxyIndex = q->mapFromSource(sourceIndex);
218 Q_EMIT q->dataChanged(parent, parent, roles);
224 if (!parent.
isValid() && !groupDemandingAttention && roles.
contains(AbstractTasksModel::IsDemandingAttention)
225 && !sourceIndex.
data(AbstractTasksModel::IsDemandingAttention).
toBool()) {
226 if (shouldGroupTasks() && tryToGroup(sourceIndex)) {
231 Q_EMIT q->dataChanged(proxyIndex, proxyIndex, roles);
234 Q_EMIT q->dataChanged(proxyIndex, proxyIndex, roles);
239void TaskGroupingProxyModel::Private::adjustMap(
int anchor,
int delta)
241 for (
int i = 0; i < rowMap.
count(); ++i) {
243 for (
auto it = sourceRows->
begin(); it != sourceRows->
end(); ++it) {
244 if ((*it) >= anchor) {
251void TaskGroupingProxyModel::Private::rebuildMap()
256 const int rows = q->sourceModel()->rowCount();
260 for (
int i = 0; i < rows; ++i) {
264 checkGrouping(
true );
267bool TaskGroupingProxyModel::Private::shouldGroupTasks()
269 if (groupMode == TasksModel::GroupDisabled) {
273 if (windowTasksThreshold != -1) {
280 int windowTasksCount = 0;
282 for (
int i = 0; i < q->sourceModel()->rowCount(); ++i) {
283 const QModelIndex &idx = q->sourceModel()->index(i, 0);
285 if (idx.
data(AbstractTasksModel::IsWindow).
toBool()) {
290 return (windowTasksCount > windowTasksThreshold);
296void TaskGroupingProxyModel::Private::checkGrouping(
bool silent)
298 if (shouldGroupTasks()) {
299 for (
int i = (rowMap.
count()) - 1; i >= 0; --i) {
304 if (tryToGroup(q->sourceModel()->index(rowMap.
at(i)->constFirst(), 0), silent)) {
311 for (
int i = (rowMap.
count()) - 1; i >= 0; --i) {
312 breakGroupFor(q->index(i, 0), silent);
317bool TaskGroupingProxyModel::Private::isBlacklisted(
const QModelIndex &sourceIndex)
325 if (blacklistedLauncherUrls.
count()) {
326 const QUrl &launcherUrl = sourceIndex.
data(AbstractTasksModel::LauncherUrlWithoutIcon).
toUrl();
329 if (blacklistedLauncherUrls.
contains(launcherUrlString)) {
337bool TaskGroupingProxyModel::Private::tryToGroup(
const QModelIndex &sourceIndex,
bool silent)
343 if (!sourceIndex.
data(AbstractTasksModel::IsWindow).
toBool()) {
350 if (!groupDemandingAttention && sourceIndex.
data(AbstractTasksModel::IsDemandingAttention).
toBool()) {
355 if (isBlacklisted(sourceIndex)) {
361 for (
int i = 0; i < rowMap.
count(); ++i) {
362 const QModelIndex &groupRep = q->sourceModel()->index(rowMap.
at(i)->constFirst(), 0);
365 if (sourceIndex == groupRep) {
370 if (!groupRep.
data(AbstractTasksModel::IsWindow).
toBool()) {
374 if (appsMatch(sourceIndex, groupRep)) {
378 const int newIndex = rowMap.
at(i)->count();
381 q->beginInsertRows(parent, 0, 1);
383 q->beginInsertRows(parent, newIndex, newIndex);
392 Q_EMIT q->dataChanged(parent, parent);
402void TaskGroupingProxyModel::Private::formGroupFor(
const QModelIndex &index)
411 const QModelIndex &sourceTarget = q->mapToSource(index);
413 for (
int i = (rowMap.
count() - 1); i >= 0; --i) {
414 const QModelIndex &sourceIndex = q->sourceModel()->index(rowMap.
at(i)->constFirst(), 0);
416 if (!appsMatch(sourceTarget, sourceIndex)) {
420 if (tryToGroup(sourceIndex)) {
428void TaskGroupingProxyModel::Private::breakGroupFor(
const QModelIndex &index,
bool silent)
430 const int row = index.
row();
445 q->beginRemoveRows(index, 0, extraChildren.
count());
454 Q_EMIT q->dataChanged(index, index);
459 for (
int i = 0; i < extraChildren.
count(); ++i) {
468TaskGroupingProxyModel::TaskGroupingProxyModel(
QObject *parent)
470 , d(new Private(this))
474TaskGroupingProxyModel::~TaskGroupingProxyModel()
480 if (row < 0 || column != 0) {
484 if (parent.
isValid() && row < d->rowMap.
at(parent.
row())->count()) {
485 return createIndex(row, column, d->rowMap.at(parent.
row()));
488 if (row < d->rowMap.
count()) {
489 return createIndex(row, column,
nullptr);
502 if (parentRow != -1) {
503 return index(parentRow, 0);
508 Q_ASSERT(parentRow != -1);
516 if (!sourceIndex.
isValid() || sourceIndex.
model() != sourceModel()) {
520 for (
int i = 0; i < d->rowMap.count(); ++i) {
522 const int childIndex = sourceRows->
indexOf(sourceIndex.
row());
525 if (childIndex == 0) {
531 return index(0, 0, parent);
536 }
else if (childIndex != -1) {
537 return index(childIndex, 0, parent);
546 if (!proxyIndex.
isValid() || proxyIndex.
model() !=
this || !sourceModel()) {
553 if (parent.
row() < 0 || parent.
row() >= d->rowMap.count()) {
557 return sourceModel()->index(d->rowMap.at(parent.
row())->at(proxyIndex.
row()), 0);
565 return sourceModel()->index(d->rowMap.at(proxyIndex.
row())->at(0), 0);
571int TaskGroupingProxyModel::rowCount(
const QModelIndex &parent)
const
573 if (!sourceModel()) {
584 if (parent.
row() < 0 || parent.
row() >= d->rowMap.count()) {
588 const uint rowCount = d->rowMap.at(parent.
row())->count();
599 return d->rowMap.count();
602bool TaskGroupingProxyModel::hasChildren(
const QModelIndex &parent)
const
604 if ((parent.
model() && parent.
model() !=
this) || !sourceModel()) {
608 return rowCount(parent);
611int TaskGroupingProxyModel::columnCount(
const QModelIndex &parent)
const
625 const bool isWindowGroup = (!parent.isValid() && d->isGroup(proxyIndex.
row()));
628 const QModelIndex &sourceIndex = mapToSource(proxyIndex);
635 return !d->isBlacklisted(sourceIndex);
654 for (
int i = 0; i < rowCount(proxyIndex); ++i) {
660 return QStringLiteral(
"windowsystem/multiple-winids");
667 return rowCount(proxyIndex);
703 for (
int i = 0; i < rowCount(proxyIndex); ++i) {
717 for (
int i = 0; i < rowCount(proxyIndex); ++i) {
729 const int groupSize = d->rowMap.at(proxyIndex.
row())->size();
732 for (
int i = 1; i < groupSize; i++) {
735 if (lastActivated < activated) {
736 lastActivated = activated;
740 return lastActivated;
744 return sourceIndex.
data(role);
760 d->abstractTasksSourceModel =
dynamic_cast<AbstractTasksModelIface *
>(sourceModel);
765 using namespace std::placeholders;
770 std::bind(&TaskGroupingProxyModel::Private::sourceRowsAboutToBeInserted, dd, _1, _2, _3));
775 std::bind(&TaskGroupingProxyModel::Private::sourceRowsAboutToBeRemoved, dd, _1, _2, _3));
781 qDeleteAll(d->rowMap);
795 if (d->groupMode != mode) {
800 Q_EMIT groupModeChanged();
804bool TaskGroupingProxyModel::groupDemandingAttention()
const
806 return d->groupDemandingAttention;
811 if (d->groupDemandingAttention != group) {
812 d->groupDemandingAttention = group;
816 Q_EMIT groupDemandingAttentionChanged();
820int TaskGroupingProxyModel::windowTasksThreshold()
const
822 return d->windowTasksThreshold;
827 if (d->windowTasksThreshold != threshold) {
828 d->windowTasksThreshold = threshold;
832 Q_EMIT windowTasksThresholdChanged();
838 return d->blacklistedAppIds.values();
845 if (d->blacklistedAppIds != set) {
846 d->blacklistedAppIds = set;
853 for (
int i = (d->rowMap.count() - 1); i >= 0; --i) {
858 d->breakGroupFor(groupRep);
863 Q_EMIT blacklistedAppIdsChanged();
867QStringList TaskGroupingProxyModel::blacklistedLauncherUrls()
const
869 return d->blacklistedLauncherUrls.values();
876 if (d->blacklistedLauncherUrls != set) {
877 d->blacklistedLauncherUrls = set;
884 for (
int i = (d->rowMap.count() - 1); i >= 0; --i) {
890 if (set.
contains(launcherUrlString)) {
891 d->breakGroupFor(groupRep);
896 Q_EMIT blacklistedLauncherUrlsChanged();
902 if (!d->abstractTasksSourceModel || !index.isValid() || index.model() !=
this) {
906 if (index.parent().isValid() || !d->isGroup(index.row())) {
907 d->abstractTasksSourceModel->requestActivate(mapToSource(index));
913 if (!d->abstractTasksSourceModel || !index.isValid() || index.model() !=
this) {
917 d->abstractTasksSourceModel->requestNewInstance(mapToSource(index));
922 if (!d->abstractTasksSourceModel || !index.isValid() || index.model() !=
this) {
926 d->abstractTasksSourceModel->requestOpenUrls(mapToSource(index), urls);
931 if (!d->abstractTasksSourceModel || !index.isValid() || index.model() !=
this) {
935 if (index.parent().isValid() || !d->isGroup(index.row())) {
936 d->abstractTasksSourceModel->requestClose(mapToSource(index));
938 const int row = index.row();
940 for (
int i = (rowCount(index) - 1); i >= 1; --i) {
941 const QModelIndex &sourceChild = mapToSource(this->index(i, 0, index));
942 d->abstractTasksSourceModel->requestClose(sourceChild);
945 d->abstractTasksSourceModel->requestClose(mapToSource(TaskGroupingProxyModel::index(row, 0)));
951 if (!d->abstractTasksSourceModel || !index.isValid() || index.model() !=
this) {
955 if (index.parent().isValid() || !d->isGroup(index.row())) {
956 d->abstractTasksSourceModel->requestMove(mapToSource(index));
962 if (!d->abstractTasksSourceModel || !index.isValid() || index.model() !=
this) {
966 if (index.parent().isValid() || !d->isGroup(index.row())) {
967 d->abstractTasksSourceModel->requestResize(mapToSource(index));
973 if (!d->abstractTasksSourceModel || !index.isValid() || index.model() !=
this) {
977 if (index.parent().isValid() || !d->isGroup(index.row())) {
978 d->abstractTasksSourceModel->requestToggleMinimized(mapToSource(index));
982 for (
int i = 0; i < rowCount(index); ++i) {
983 const QModelIndex &child = this->index(i, 0, index);
986 d->abstractTasksSourceModel->requestToggleMinimized(mapToSource(child));
994 if (!d->abstractTasksSourceModel || !index.isValid() || index.model() !=
this) {
998 if (index.parent().isValid() || !d->isGroup(index.row())) {
999 d->abstractTasksSourceModel->requestToggleMaximized(mapToSource(index));
1003 QModelIndexList inStackingOrder;
1005 for (
int i = 0; i < rowCount(index); ++i) {
1006 const QModelIndex &child = this->index(i, 0, index);
1009 inStackingOrder << mapToSource(child);
1013 std::sort(inStackingOrder.begin(), inStackingOrder.end(), [](
const QModelIndex &a,
const QModelIndex &b) {
1014 return (a.data(AbstractTasksModel::StackingOrder).toInt() < b.data(AbstractTasksModel::StackingOrder).toInt());
1017 for (
const QModelIndex &sourceChild : std::as_const(inStackingOrder)) {
1018 d->abstractTasksSourceModel->requestToggleMaximized(sourceChild);
1025 if (!d->abstractTasksSourceModel || !index.isValid() || index.model() !=
this) {
1029 if (index.parent().isValid() || !d->isGroup(index.row())) {
1030 d->abstractTasksSourceModel->requestToggleKeepAbove(mapToSource(index));
1034 for (
int i = 0; i < rowCount(index); ++i) {
1035 const QModelIndex &child = this->index(i, 0, index);
1038 d->abstractTasksSourceModel->requestToggleKeepAbove(mapToSource(child));
1046 if (!d->abstractTasksSourceModel || !index.isValid() || index.model() !=
this) {
1050 if (index.parent().isValid() || !d->isGroup(index.row())) {
1051 d->abstractTasksSourceModel->requestToggleKeepBelow(mapToSource(index));
1055 for (
int i = 0; i < rowCount(index); ++i) {
1056 const QModelIndex &child = this->index(i, 0, index);
1059 d->abstractTasksSourceModel->requestToggleKeepBelow(mapToSource(child));
1067 if (!d->abstractTasksSourceModel || !index.isValid() || index.model() !=
this) {
1071 if (index.parent().isValid() || !d->isGroup(index.row())) {
1072 d->abstractTasksSourceModel->requestToggleFullScreen(mapToSource(index));
1076 for (
int i = 0; i < rowCount(index); ++i) {
1077 const QModelIndex &child = this->index(i, 0, index);
1080 d->abstractTasksSourceModel->requestToggleFullScreen(mapToSource(child));
1088 if (!d->abstractTasksSourceModel || !index.isValid() || index.model() !=
this) {
1092 if (index.parent().isValid() || !d->isGroup(index.row())) {
1093 d->abstractTasksSourceModel->requestToggleShaded(mapToSource(index));
1097 for (
int i = 0; i < rowCount(index); ++i) {
1098 const QModelIndex &child = this->index(i, 0, index);
1101 d->abstractTasksSourceModel->requestToggleShaded(mapToSource(child));
1109 if (!d->abstractTasksSourceModel || !index.isValid() || index.model() !=
this) {
1113 if (index.parent().isValid() || !d->isGroup(index.row())) {
1114 d->abstractTasksSourceModel->requestVirtualDesktops(mapToSource(index), desktops);
1118 const int childCount = rowCount(index);
1120 groupChildren.
reserve(childCount);
1122 for (
int i = (childCount - 1); i >= 0; --i) {
1123 groupChildren.
append(mapToSource(this->index(i, 0, index)));
1127 d->abstractTasksSourceModel->requestVirtualDesktops(idx, desktops);
1134 if (!d->abstractTasksSourceModel || !index.isValid() || index.model() !=
this) {
1138 if (index.parent().isValid() || !d->isGroup(index.row())) {
1139 d->abstractTasksSourceModel->requestNewVirtualDesktop(mapToSource(index));
1143 const int childCount = rowCount(index);
1145 groupChildren.
reserve(childCount);
1147 for (
int i = (childCount - 1); i >= 0; --i) {
1148 groupChildren.
append(mapToSource(this->index(i, 0, index)));
1152 d->abstractTasksSourceModel->requestNewVirtualDesktop(idx);
1159 if (!d->abstractTasksSourceModel || !index.isValid() || index.model() !=
this) {
1163 if (index.parent().isValid() || !d->isGroup(index.row())) {
1164 d->abstractTasksSourceModel->requestActivities(mapToSource(index), activities);
1168 const int childCount = rowCount(index);
1170 groupChildren.
reserve(childCount);
1172 for (
int i = (childCount - 1); i >= 0; --i) {
1173 groupChildren.
append(mapToSource(this->index(i, 0, index)));
1177 d->abstractTasksSourceModel->requestActivities(idx, activities);
1184 if (!d->abstractTasksSourceModel || !index.isValid() || index.model() !=
this) {
1188 if (index.parent().isValid() || !d->isGroup(index.row())) {
1189 d->abstractTasksSourceModel->requestPublishDelegateGeometry(mapToSource(index), geometry, delegate);
1191 for (
int i = 0; i < rowCount(index); ++i) {
1192 d->abstractTasksSourceModel->requestPublishDelegateGeometry(mapToSource(this->index(i, 0, index)), geometry, delegate);
1203 if (d->blacklistedAppIds.contains(appId) || d->blacklistedLauncherUrls.contains(launcherUrlString)) {
1204 d->blacklistedAppIds.remove(appId);
1205 d->blacklistedLauncherUrls.remove(launcherUrlString);
1208 d->formGroupFor(index.parent().isValid() ? index.parent() : index);
1211 d->blacklistedAppIds.insert(appId);
1212 d->blacklistedLauncherUrls.insert(launcherUrlString);
1215 d->breakGroupFor(index.parent().isValid() ? index.parent() : index);
1222 for (
int i = 0; i < d->rowMap.count(); ++i) {
1223 if (!d->isGroup(i)) {
1224 const QModelIndex &idx = TaskGroupingProxyModel::index(i, 0);
1233 Q_EMIT blacklistedAppIdsChanged();
1234 Q_EMIT blacklistedLauncherUrlsChanged();
1239#include "moc_taskgroupingproxymodel.cpp"
@ IsGroupable
Whether this task is being ignored by grouping or not.
@ MimeType
MIME type for this task (window, window group), needed for DND.
@ IsClosable
requestClose (see below) available.
@ Activities
Activities for the task (i.e.
@ IsDemandingAttention
Task is demanding attention.
@ IsHidden
Task (i.e window) is hidden on screen.
@ IsActive
This is the currently active task.
@ SkipTaskbar
Task should not be shown in a 'task bar' user interface.
@ MimeData
Data for MimeType.
@ IsFullScreenable
requestToggleFullScreen (see below) available.
@ IsVirtualDesktopsChangeable
requestVirtualDesktop (see below) available.
@ IsGroupParent
This is a parent item for a group of child tasks.
@ AppName
Application name.
@ VirtualDesktops
Virtual desktops for the task (i.e.
@ IsShadeable
requestToggleShade (see below) available.
@ IsResizable
requestResize (see below) available.
@ WinIdList
NOTE: On Wayland, these ids are only useful within the same process.
@ LauncherUrlWithoutIcon
Special path to get a launcher URL while skipping fallback icon encoding.
@ IsMinimizable
requestToggleMinimize (see below) available.
@ LastActivated
The timestamp of the last time a task was the active task.
@ IsMovable
requestMove (see below) available.
@ AppId
KService storage id (.desktop name sans extension).
@ ChildCount
The number of tasks in this group.
@ ScreenGeometry
Screen geometry for the task (i.e.
@ IsMaximizable
requestToggleMaximize (see below) available.
A proxy tasks model for grouping tasks, forming a tree.
void requestNewInstance(const QModelIndex &index) override
Request an additional instance of the application backing the task at the given index.
void requestToggleKeepAbove(const QModelIndex &index) override
Request toggling the keep-above state of the task at the given index.
void requestNewVirtualDesktop(const QModelIndex &index) override
Request entering the window at the given index on a new virtual desktop, which is created in response...
void requestMove(const QModelIndex &index) override
Request starting an interactive move for the task at the given index.
void setGroupDemandingAttention(bool group)
Sets whether new tasks which demand attention (AbstractTasksModel::IsDemandingAttention) should be gr...
void requestToggleFullScreen(const QModelIndex &index) override
Request toggling the fullscreen state of the task at the given index.
void setBlacklistedLauncherUrls(const QStringList &list)
Sets the blacklist of launcher URLs (AbstractTasksModel::LauncherUrl) that is consulted before groupi...
void requestToggleShaded(const QModelIndex &index) override
Request toggling the shaded state of the task at the given index.
void setWindowTasksThreshold(int threshold)
Sets the number of source model window tasks (AbstractTasksModel::IsWindow) above which groups will b...
void requestToggleKeepBelow(const QModelIndex &index) override
Request toggling the keep-below state of the task at the given index.
void requestResize(const QModelIndex &index) override
Request starting an interactive resize for the task at the given index.
void requestClose(const QModelIndex &index) override
Request the task at the given index be closed.
void setGroupMode(TasksModel::GroupMode mode)
Sets the group mode, i.e.
void requestToggleMaximized(const QModelIndex &index) override
Request toggling the maximized state of the task at the given index.
void requestPublishDelegateGeometry(const QModelIndex &index, const QRect &geometry, QObject *delegate=nullptr) override
Request informing the window manager of new geometry for a visual delegate for the task at the given ...
void requestToggleMinimized(const QModelIndex &index) override
Request toggling the minimized state of the task at the given index.
void requestVirtualDesktops(const QModelIndex &index, const QVariantList &desktops) override
Request entering the window at the given index on the specified virtual desktops, leaving any other d...
void requestOpenUrls(const QModelIndex &index, const QList< QUrl > &urls) override
Requests to open the given URLs with the application backing the task at the given index.
void requestToggleGrouping(const QModelIndex &index)
Request toggling whether the task at the given index, along with any tasks matching its kind,...
void requestActivate(const QModelIndex &index) override
Request activation of the task at the given index.
void requestActivities(const QModelIndex &index, const QStringList &activities) override
Request moving the task at the given index to the specified activities.
void setBlacklistedAppIds(const QStringList &list)
Sets the blacklist of app ids (AbstractTasksModel::AppId) that is consulted before grouping a task.
QVariant data(const QModelIndex &proxyIndex, int role) const override
@ GroupDisabled
No grouping is done.
Q_SCRIPTABLE QString start(QString train="")
Q_SCRIPTABLE Q_NOREPLY void start()
const QList< QKeySequence > & end()
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles)
void modelAboutToBeReset()
void rowsAboutToBeInserted(const QModelIndex &parent, int start, int end)
void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last)
void rowsInserted(const QModelIndex &parent, int first, int last)
void rowsRemoved(const QModelIndex &parent, int first, int last)
virtual void setSourceModel(QAbstractItemModel *sourceModel)
void append(QList< T > &&value)
const_reference at(qsizetype i) const const
const_iterator cbegin() const const
const_iterator cend() const const
bool contains(const AT &value) const const
qsizetype count() const const
qsizetype indexOf(const AT &value, qsizetype from) const const
void remove(qsizetype i, qsizetype n)
void reserve(qsizetype size)
void resize(qsizetype size)
QVariant data(int role) const const
void * internalPointer() const const
bool isValid() const const
const QAbstractItemModel * model() const const
QModelIndex parent() const const
bool contains(const QSet< T > &other) const const
qsizetype count() const const
bool isEmpty() const const
qsizetype removeDuplicates()
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
QString toString(FormattingOptions options) const const
bool toBool() const const
QString toString() const const