mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Correctly set items flags in TorrentContentModel
Only set editable flag on item's where editing is handled in the delegate closes #13515
This commit is contained in:
parent
70b242f190
commit
36d7fce909
1 changed files with 5 additions and 2 deletions
|
@ -384,10 +384,13 @@ Qt::ItemFlags TorrentContentModel::flags(const QModelIndex &index) const
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
return Qt::NoItemFlags;
|
return Qt::NoItemFlags;
|
||||||
|
|
||||||
|
Qt::ItemFlags flags {Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable};
|
||||||
if (itemType(index) == TorrentContentModelItem::FolderType)
|
if (itemType(index) == TorrentContentModelItem::FolderType)
|
||||||
return Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsTristate;
|
flags |= Qt::ItemIsTristate;
|
||||||
|
if (index.column() == TorrentContentModelItem::COL_PRIO)
|
||||||
|
flags |= Qt::ItemIsEditable;
|
||||||
|
|
||||||
return Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant TorrentContentModel::headerData(int section, Qt::Orientation orientation, int role) const
|
QVariant TorrentContentModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue