![]() |
LeechCraft 0.6.70-19214-g121e5318a7
Modular cross-platform feature rich live environment.
|
#include "flattofoldersproxymodel.h"
Public Member Functions | |
| FlatToFoldersProxyModel (const ITagsManager *, 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 |
Groups the rows of a flat source model into folders by tag.
Tags are read from column 0 of each source row via CustomDataRoles::Tags, and the tags manager resolves them to the folder titles. A row appears under every tag it has, and rows without tags go into a single untagged folder. Leaves expose the columns of their source rows and map back via MapToSource().
The source must be flat, and its layout changes must move rows as units, as every row sort does. Layout changes of the source are not forwarded, and a source rearranging cells independently of each other is not supported.
Definition at line 39 of file flattofoldersproxymodel.h.
|
explicit |
Definition at line 84 of file flattofoldersproxymodel.cpp.
References LC::Util::InstallModelSanitizer(), and parent().
|
override |
Definition at line 92 of file flattofoldersproxymodel.cpp.
|
override |
Definition at line 99 of file flattofoldersproxymodel.cpp.
References LC::Util::FlatTreeItem::Folder, index(), LC::Util::FlatTreeItem::Item, and LC::Tags.
Referenced by dropMimeData().
|
override |
Definition at line 238 of file flattofoldersproxymodel.cpp.
References data(), and parent().
|
override |
Definition at line 142 of file flattofoldersproxymodel.cpp.
References index(), and LC::Util::FlatTreeItem::Item.
| QList< QModelIndex > LC::Util::FlatToFoldersProxyModel::GetChildren | ( | const QModelIndex & | index | ) | const |
Definition at line 329 of file flattofoldersproxymodel.cpp.
References index(), and IsFolder().
Referenced by GetChildrenData().
|
inline |
Definition at line 74 of file flattofoldersproxymodel.h.
References GetChildrenData(), and index().
| QList< QVariant > LC::Util::FlatToFoldersProxyModel::GetChildrenData | ( | const QModelIndex & | index, |
| int | role ) const |
Definition at line 342 of file flattofoldersproxymodel.cpp.
References GetChildren(), and index().
Referenced by GetChildrenData().
| QAbstractItemModel * LC::Util::FlatToFoldersProxyModel::GetSourceModel | ( | ) | const |
Definition at line 294 of file flattofoldersproxymodel.cpp.
Referenced by MapToSource().
|
override |
Definition at line 134 of file flattofoldersproxymodel.cpp.
|
override |
Definition at line 173 of file flattofoldersproxymodel.cpp.
References parent().
Referenced by data(), flags(), GetChildren(), GetChildrenData(), IsFolder(), mimeData(), parent(), rowCount(), and setData().
| bool LC::Util::FlatToFoldersProxyModel::IsFolder | ( | const QModelIndex & | index | ) | const |
Definition at line 323 of file flattofoldersproxymodel.cpp.
References LC::Util::FlatTreeItem::Folder, and index().
Referenced by GetChildren().
| QList< QModelIndex > LC::Util::FlatToFoldersProxyModel::MapFromSource | ( | const QModelIndex & | source | ) | const |
Definition at line 315 of file flattofoldersproxymodel.cpp.
| QModelIndex LC::Util::FlatToFoldersProxyModel::MapToSource | ( | const QModelIndex & | proxy | ) | const |
Definition at line 299 of file flattofoldersproxymodel.cpp.
References GetSourceModel(), and LC::Util::FlatTreeItem::Item.
Referenced by mimeData().
|
override |
Definition at line 212 of file flattofoldersproxymodel.cpp.
References LC::Util::FlatTreeItem::Folder, index(), LC::Util::FlatTreeItem::Item, and MapToSource().
|
override |
Definition at line 205 of file flattofoldersproxymodel.cpp.
|
override |
Definition at line 181 of file flattofoldersproxymodel.cpp.
References index(), parent(), and LC::Util::FlatTreeItem::Root.
Referenced by FlatToFoldersProxyModel(), dropMimeData(), index(), and parent().
|
override |
Definition at line 190 of file flattofoldersproxymodel.cpp.
References index().
|
override |
Definition at line 160 of file flattofoldersproxymodel.cpp.
References index(), and LC::Util::FlatTreeItem::Item.
| void LC::Util::FlatToFoldersProxyModel::SetSourceModel | ( | QAbstractItemModel * | model | ) |
Definition at line 253 of file flattofoldersproxymodel.cpp.
|
override |
Definition at line 198 of file flattofoldersproxymodel.cpp.