Akonadi::TodoModel Class

Header: #include <todomodel.h>
CMake: find_package(KPim6AkonadiCalendar REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::AkonadiCalendar)

Public Types

enum { SummaryColumn, RecurColumn, PriorityColumn, PercentColumn, StartDateColumn, …, ColumnCount }
enum { TodoRole, TodoPtrRole, IsRichTextRole, SummaryRole, RecurRole, …, CalendarRole }

Public Functions

TodoModel(QObject *parent = nullptr)
virtual ~TodoModel() override
void setIncidenceChanger(Akonadi::IncidenceChanger *changer)

Reimplemented Public Functions

virtual int columnCount(const QModelIndex &parent = QModelIndex()) const override
virtual QVariant data(const QModelIndex &index, int role) const override
virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
virtual QVariant extraColumnData(const QModelIndex &parent, int row, int extraColumn, int role = Qt::DisplayRole) const override
virtual Qt::ItemFlags flags(const QModelIndex &index) const override
virtual QVariant headerData(int column, Qt::Orientation orientation, int role) const override
virtual QMimeData *mimeData(const QModelIndexList &indexes) const override
virtual QStringList mimeTypes() const override
virtual QHash<int, QByteArray> roleNames() const override
virtual bool setData(const QModelIndex &index, const QVariant &value, int role) override
virtual void setSourceModel(QAbstractItemModel *sourceModel) override
virtual Qt::DropActions supportedDropActions() const override

Signals

Detailed Description

Expands an IncidenceTreeModel by additional columns for showing todos.

Member Type Documentation

[anonymous] enum

This enum defines all columns this model provides

[anonymous] enum

This enum defines the user defined roles of the items in this model

Member Function Documentation

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

Creates a new TodoModel.

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

Destroys the TodoModel.

[override virtual] int TodoModel::columnCount(const QModelIndex &parent = QModelIndex()) const

Returns the number of columns for the given parent index.

[override virtual] QVariant TodoModel::data(const QModelIndex &index, int role) const

Returns the data stored under the given role for the item referred to by the index.

See also setData().

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

Handles the drop of MIME data.

[signal] void TodoModel::dropOnSelfRejected()

Emitted when dropMimeData() rejected a drop on the same item or any of its children.

[override virtual] QVariant TodoModel::extraColumnData(const QModelIndex &parent, int row, int extraColumn, int role = Qt::DisplayRole) const

Returns data for the extra column.

[override virtual] Qt::ItemFlags TodoModel::flags(const QModelIndex &index) const

Returns the item flags for the given index.

[override virtual] QVariant TodoModel::headerData(int column, Qt::Orientation orientation, int role) const

Returns the data for the given role and section in the header.

[override virtual] QMimeData *TodoModel::mimeData(const QModelIndexList &indexes) const

Returns the MIME data of the given indexes.

[override virtual] QStringList TodoModel::mimeTypes() const

Returns the MIME types supported by this model.

[override virtual] QHash<int, QByteArray> TodoModel::roleNames() const

Returns the model's role names.

[override virtual] bool TodoModel::setData(const QModelIndex &index, const QVariant &value, int role)

Sets the role data for the item at index to value.

See also data().

void TodoModel::setIncidenceChanger(Akonadi::IncidenceChanger *changer)

Sets the incidence changer.

[override virtual] void TodoModel::setSourceModel(QAbstractItemModel *sourceModel)

Sets the source model.

[override virtual] Qt::DropActions TodoModel::supportedDropActions() const

Returns the drop actions supported by this model.