Akonadi::TrashFilterProxyModel Class
class Akonadi::TrashFilterProxyModelFilter model which hides/shows entities marked as trash. More...
| Header: | #include <Akonadi/TrashFilterProxyModel> |
| CMake: | find_package(KPim6 REQUIRED COMPONENTS AkonadiCore)target_link_libraries(mytarget PRIVATE KPim6::AkonadiCore) |
Reimplemented Protected Functions
| virtual bool | filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override |
Detailed Description
Filter model which either hides all entities marked as trash, or the ones not marked. Subentities of collections marked as trash are also shown in the trash.
The Base model must be an EntityTreeModel and the EntityDeletedAttribute must be available.
Example:
ChangeRecorder *monitor = new Akonadi::ChangeRecorder( this ); monitor->itemFetchScope().fetchAttribute<Akonadi::EntityDisplayAttribute>(true); Akonadi::EntityTreeModel *sourcemodel = new Akonadi::EntityTreeModel(monitor, this); TrashFilterProxyModel *model = new TrashFilterProxyModel(this); model->setDynamicSortFilter(true); model->setSourceModel(sourcemodel);
Author: Christian Mollekopf <chrigi_1@fastmail.fm>
Member Function Documentation
[override virtual protected] bool TrashFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
Sort filter criteria, according to how expensive the operation is