Akonadi::IncidenceTreeModel Class
| Header: | #include <incidencetreemodel.h> |
| CMake: | find_package(KPim6AkonadiCalendar REQUIRED)target_link_libraries(mytarget PRIVATE KPim6::AkonadiCalendar) |
| Inherits: | QAbstractProxyModel |
Public Functions
| IncidenceTreeModel(QObject *parent = nullptr) | |
| IncidenceTreeModel(const QStringList &mimeTypes, QObject *parent = nullptr) | |
| Akonadi::Item | item(const QString &incidenceUid) const |
Signals
| void | batchInsertionFinished() |
| void | indexChangedParent(const QModelIndex &) |
Detailed Description
Hierarchical incidence model. Useful as a source for TodoModel for example.
Member Function Documentation
[explicit] IncidenceTreeModel::IncidenceTreeModel(QObject *parent = nullptr)
Constructs a new IncidenceTreeModel.
[explicit] IncidenceTreeModel::IncidenceTreeModel(const QStringList &mimeTypes, QObject *parent = nullptr)
Constructs a new IncidenceTreeModel which will only show incidences of type mimeTypes. Common use case is a to-do tree.
This constructor is offered for performance reasons. The filtering has zero overhead, and we avoid stacking mime type filter proxy models.
If you're more concerned about clean design than performance, use the default constructor and stack a Akonadi::EntityMimeTypeFilterModel on top of this one.
[signal] void IncidenceTreeModel::batchInsertionFinished()
Signals that we finished doing a batch of insertions.
One rowsInserted() signal from the ETM, will make IncidenceTreeModel generate several rowsInserted(), layoutChanged() or rowsMoved() signals.
A tree view can use this signal to know when to call KConfigViewStateSaver::restore() to restore expansion states. Listening to rowsInserted() signals would be a performance problem.
[signal] void IncidenceTreeModel::indexChangedParent(const QModelIndex &)
This signal is emitted whenever an index changes parent. The view can then expand the parent if desired. This is better than the view waiting for "rows moved" signals because those signals are also sent when the model is initially populated.
Akonadi::Item IncidenceTreeModel::item(const QString &incidenceUid) const
Returns the akonadi item containing the incidence with incidenceUid.