LeechCraft 0.6.70-19424-g027e980fd1
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
LC::Util::TagsFoldersProxyModel Class Referencefinal

Groups the rows of a flat source model into folders by their tags. More...

#include "tagsfoldersproxymodel.h"

Inheritance diagram for LC::Util::TagsFoldersProxyModel:
Collaboration diagram for LC::Util::TagsFoldersProxyModel:

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.

Detailed Description

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.

See also
FlatToFoldersProxyModel

Definition at line 32 of file tagsfoldersproxymodel.h.

Constructor & Destructor Documentation

◆ TagsFoldersProxyModel()

LC::Util::TagsFoldersProxyModel::TagsFoldersProxyModel ( const ITagsManager & tm,
QObject * parent = nullptr )
explicit

The documentation for this class was generated from the following files:
  • /home/abuild/rpmbuild/BUILD/leechcraft-doc-0.6.70+git.19424.g027e980fd1-build/leechcraft-0.6.70-19424-g027e980fd1/src/util/tags/tagsfoldersproxymodel.h
  • /home/abuild/rpmbuild/BUILD/leechcraft-doc-0.6.70+git.19424.g027e980fd1-build/leechcraft-0.6.70-19424-g027e980fd1/src/util/tags/tagsfoldersproxymodel.cpp