mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-26 19:26:59 +03:00
Merge pull request #14157 from jagannatharjun/content-search
Correctly set items flags in TorrentContentModel
This commit is contained in:
commit
35731b96dc
1 changed files with 5 additions and 2 deletions
|
@ -384,10 +384,13 @@ Qt::ItemFlags TorrentContentModel::flags(const QModelIndex &index) const
|
|||
if (!index.isValid())
|
||||
return Qt::NoItemFlags;
|
||||
|
||||
Qt::ItemFlags flags {Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable};
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue