kcms/tabbox: Mock-up closeable role for previews
Fixes a qml warning and wrong representation when trying to access this model property
This commit is contained in:
parent
3572e6f0e7
commit
3353ed87ef
2 changed files with 5 additions and 1 deletions
|
@ -159,6 +159,8 @@ QVariant ExampleClientModel::data(const QModelIndex &index, int role) const
|
|||
return item.icon;
|
||||
case WindowIdRole:
|
||||
return item.wId;
|
||||
case CloseableRole:
|
||||
return item.wId != WindowThumbnailItem::Desktop;
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
@ -187,6 +189,7 @@ QHash<int, QByteArray> ExampleClientModel::roleNames() const
|
|||
{DesktopNameRole, QByteArrayLiteral("desktopName")},
|
||||
{IconRole, QByteArrayLiteral("icon")},
|
||||
{WindowIdRole, QByteArrayLiteral("windowId")},
|
||||
{CloseableRole, QByteArrayLiteral("closeable")},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,8 @@ public:
|
|||
MinimizedRole,
|
||||
DesktopNameRole,
|
||||
IconRole,
|
||||
WindowIdRole
|
||||
WindowIdRole,
|
||||
CloseableRole,
|
||||
};
|
||||
|
||||
explicit ExampleClientModel(QObject *parent = nullptr);
|
||||
|
|
Loading…
Reference in a new issue