LeechCraft 0.6.70-19214-g121e5318a7
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
LC::Util::FlatToFoldersProxyModel Class Reference

#include "flattofoldersproxymodel.h"

Inheritance diagram for LC::Util::FlatToFoldersProxyModel:
Collaboration diagram for LC::Util::FlatToFoldersProxyModel:

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ FlatToFoldersProxyModel()

LC::Util::FlatToFoldersProxyModel::FlatToFoldersProxyModel ( const ITagsManager * itm,
QObject * parent = nullptr )
explicit

Definition at line 84 of file flattofoldersproxymodel.cpp.

References LC::Util::InstallModelSanitizer(), and parent().

Here is the call graph for this function:

Member Function Documentation

◆ columnCount()

int LC::Util::FlatToFoldersProxyModel::columnCount ( const QModelIndex & = {}) const
override

Definition at line 92 of file flattofoldersproxymodel.cpp.

◆ data()

QVariant LC::Util::FlatToFoldersProxyModel::data ( const QModelIndex & index,
int role = Qt::DisplayRole ) const
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dropMimeData()

bool LC::Util::FlatToFoldersProxyModel::dropMimeData ( const QMimeData * data,
Qt::DropAction action,
int row,
int column,
const QModelIndex & parent )
override

Definition at line 238 of file flattofoldersproxymodel.cpp.

References data(), and parent().

Here is the call graph for this function:

◆ flags()

Qt::ItemFlags LC::Util::FlatToFoldersProxyModel::flags ( const QModelIndex & index) const
override

Definition at line 142 of file flattofoldersproxymodel.cpp.

References index(), and LC::Util::FlatTreeItem::Item.

Here is the call graph for this function:

◆ GetChildren()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetChildrenData() [1/2]

template<typename T>
QList< T > LC::Util::FlatToFoldersProxyModel::GetChildrenData ( const QModelIndex & index,
int role ) const
inline

Definition at line 74 of file flattofoldersproxymodel.h.

References GetChildrenData(), and index().

Here is the call graph for this function:

◆ GetChildrenData() [2/2]

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSourceModel()

QAbstractItemModel * LC::Util::FlatToFoldersProxyModel::GetSourceModel ( ) const

Definition at line 294 of file flattofoldersproxymodel.cpp.

Referenced by MapToSource().

Here is the caller graph for this function:

◆ headerData()

QVariant LC::Util::FlatToFoldersProxyModel::headerData ( int section,
Qt::Orientation orient,
int role ) const
override

Definition at line 134 of file flattofoldersproxymodel.cpp.

◆ index()

QModelIndex LC::Util::FlatToFoldersProxyModel::index ( int row,
int column,
const QModelIndex & parent = {} ) const
override

Definition at line 173 of file flattofoldersproxymodel.cpp.

References parent().

Referenced by data(), flags(), GetChildren(), GetChildrenData(), IsFolder(), mimeData(), parent(), rowCount(), and setData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsFolder()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MapFromSource()

QList< QModelIndex > LC::Util::FlatToFoldersProxyModel::MapFromSource ( const QModelIndex & source) const

Definition at line 315 of file flattofoldersproxymodel.cpp.

◆ MapToSource()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mimeData()

QMimeData * LC::Util::FlatToFoldersProxyModel::mimeData ( const QModelIndexList & indexes) const
override

Definition at line 212 of file flattofoldersproxymodel.cpp.

References LC::Util::FlatTreeItem::Folder, index(), LC::Util::FlatTreeItem::Item, and MapToSource().

Here is the call graph for this function:

◆ mimeTypes()

QStringList LC::Util::FlatToFoldersProxyModel::mimeTypes ( ) const
override

Definition at line 205 of file flattofoldersproxymodel.cpp.

◆ parent()

QModelIndex LC::Util::FlatToFoldersProxyModel::parent ( const QModelIndex & index) const
override

Definition at line 181 of file flattofoldersproxymodel.cpp.

References index(), parent(), and LC::Util::FlatTreeItem::Root.

Referenced by FlatToFoldersProxyModel(), dropMimeData(), index(), and parent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rowCount()

int LC::Util::FlatToFoldersProxyModel::rowCount ( const QModelIndex & index = {}) const
override

Definition at line 190 of file flattofoldersproxymodel.cpp.

References index().

Here is the call graph for this function:

◆ setData()

bool LC::Util::FlatToFoldersProxyModel::setData ( const QModelIndex & index,
const QVariant & value,
int role = Qt::EditRole )
override

Definition at line 160 of file flattofoldersproxymodel.cpp.

References index(), and LC::Util::FlatTreeItem::Item.

Here is the call graph for this function:

◆ SetSourceModel()

void LC::Util::FlatToFoldersProxyModel::SetSourceModel ( QAbstractItemModel * model)

Definition at line 253 of file flattofoldersproxymodel.cpp.

◆ supportedDropActions()

Qt::DropActions LC::Util::FlatToFoldersProxyModel::supportedDropActions ( ) const
override

Definition at line 198 of file flattofoldersproxymodel.cpp.


The documentation for this class was generated from the following files:
  • /home/abuild/rpmbuild/BUILD/leechcraft-doc-0.6.70+git.19214.g121e5318a7-build/leechcraft-0.6.70-19214-g121e5318a7/src/util/models/flattofoldersproxymodel.h
  • /home/abuild/rpmbuild/BUILD/leechcraft-doc-0.6.70+git.19214.g121e5318a7-build/leechcraft-0.6.70-19214-g121e5318a7/src/util/models/flattofoldersproxymodel.cpp