![]() |
LeechCraft 0.6.70-19424-g027e980fd1
Modular cross-platform feature rich live environment.
|
Groups the rows of a flat source model into folders by their tags. More...
#include "tagsfoldersproxymodel.h"
Public Member Functions | |
| TagsFoldersProxyModel (const ITagsManager &, QObject *=nullptr) | |
| Public Member Functions inherited from LC::Util::FlatToFoldersProxyModel | |
| FlatToFoldersProxyModel (Config, QObject *=nullptr) | |
| int | columnCount (const QModelIndex &={}) const override |
| QVariant | data (const QModelIndex &, int=Qt::DisplayRole) const override |
| QVariant | headerData (int, Qt::Orientation, int) const override |
| Qt::ItemFlags | flags (const QModelIndex &) const override |
| bool | setData (const QModelIndex &, const QVariant &, int=Qt::EditRole) override |
| QModelIndex | index (int, int, const QModelIndex &={}) const override |
| QModelIndex | parent (const QModelIndex &) const override |
| int | rowCount (const QModelIndex &={}) const override |
| Qt::DropActions | supportedDropActions () const override |
| QStringList | mimeTypes () const override |
| QMimeData * | mimeData (const QModelIndexList &indexes) const override |
| bool | dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override |
| void | SetSourceModel (QAbstractItemModel *) |
| QAbstractItemModel * | GetSourceModel () const |
| QModelIndex | MapToSource (const QModelIndex &) const |
| QList< QModelIndex > | MapFromSource (const QModelIndex &) const |
| bool | IsFolder (const QModelIndex &) const |
| QList< QModelIndex > | GetChildren (const QModelIndex &) const |
| QList< QVariant > | GetChildrenData (const QModelIndex &index, int role) const |
| template<typename T> | |
| QList< T > | GetChildrenData (const QModelIndex &index, int role) const |
| void | ReplaceKey (const QString &old, const QStringList &newKeys) |
| Updates the folders after the key old was replaced with newKeys on every row that had it, the other keys of the rows being unchanged. | |
Groups the rows of a flat source model into folders by their tags.
The tags of a row are read from its column 0 via CustomDataRoles::Tags as a QList<TagId> and resolved through the tags manager, so the row appears under the folder of every name its tags have, and the rows whose tags have no names go into the untagged folder. A drop onto a folder carries the folder's name under the x-leechcraft/tag format, empty for the untagged folder. The folders follow the name replacements the tags manager announces.
The tags manager shall outlive the model.
Definition at line 32 of file tagsfoldersproxymodel.h.
|
explicit |
Definition at line 33 of file tagsfoldersproxymodel.cpp.
References LC::Util::FlatToFoldersProxyModel::FlatToFoldersProxyModel(), ITagsManager::GetEmitter(), LC::Util::Emitters::TagsManager::nameReplaced(), LC::Util::FlatToFoldersProxyModel::parent(), and LC::Util::FlatToFoldersProxyModel::ReplaceKey().