Akonadi::EntityOrderProxyModel Class

class Akonadi::EntityOrderProxyModel

A model that keeps the order of entities persistent. More...

Header: #include <Akonadi/EntityOrderProxyModel>
CMake: find_package(KPim6 REQUIRED COMPONENTS AkonadiCore)
target_link_libraries(mytarget PRIVATE KPim6::AkonadiCore)
Inherits: QSortFilterProxyModel

Public Functions

EntityOrderProxyModel(QObject *parent = nullptr)
virtual ~EntityOrderProxyModel() override
void saveOrder()
void setOrderConfig(const KConfigGroup &group)

Reimplemented Public Functions

virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const override
virtual QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits = 1, Qt::MatchFlags flags = Qt::MatchFlags(Qt::MatchStartsWith | Qt::MatchWrap)) const override

Detailed Description

This proxy maintains the order of entities in a tree. The user can re-order items and the new order will be persisted restored on reset or restart.

Author: Stephen Kelly <stephen@kdab.com>

Member Function Documentation

[explicit] EntityOrderProxyModel::EntityOrderProxyModel(QObject *parent = nullptr)

Creates a new entity order proxy model.

parent The parent object.

[override virtual noexcept] EntityOrderProxyModel::~EntityOrderProxyModel()

Destroys the entity order proxy model.

[override virtual] bool EntityOrderProxyModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)

Reimplements: QSortFilterProxyModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent).

[override virtual] bool EntityOrderProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const

Reimplements: QSortFilterProxyModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const.

[override virtual] QModelIndexList EntityOrderProxyModel::match(const QModelIndex &start, int role, const QVariant &value, int hits = 1, Qt::MatchFlags flags = Qt::MatchFlags(Qt::MatchStartsWith | Qt::MatchWrap)) const

Reimplements: QSortFilterProxyModel::match(const QModelIndex &start, int role, const QVariant &value, int hits, Qt::MatchFlags flags) const.

void EntityOrderProxyModel::saveOrder()

Saves the order.

void EntityOrderProxyModel::setOrderConfig(const KConfigGroup &group)

Sets the config group that will be used for storing the order.