sublime
Sublime::AggregateModel Class Reference
#include <aggregatemodel.h>
Inheritance diagram for Sublime::AggregateModel:

Detailed Description
A model to combine several QStandardItemModel's into one.Combine standard models into the aggregate model to display them in the one view.
Each new model gets its own parent item to differentiate items between different models, for example:
Tea Model:
- Black - Green - White
- Arabica - Robusta
When aggregated with
AggregateModel model;
model->addModel("Tea", teaModel);
model->addModel("Coffee", coffeeModel);
- Tea
- Black
- Green
- White
- Coffee
- Arabica
- Robusta
- Note:
- It is impossible to aggregate any model, aggregation works only for standard models.
Currently aggregate model displays only 1 column.
Definition at line 70 of file aggregatemodel.h.
Public Member Functions | |
| void | addModel (const QString &name, QStandardItemModel *model) |
| AggregateModel (QObject *parent=0) | |
| virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const |
| virtual QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
| virtual Qt::ItemFlags | flags (const QModelIndex &index) const |
| virtual QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
| virtual QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const |
| virtual QModelIndex | parent (const QModelIndex &index) const |
| void | removeModel (QStandardItemModel *model) |
| virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const |
Member Function Documentation
| void Sublime::AggregateModel::addModel | ( | const QString & | name, | |
| QStandardItemModel * | model | |||
| ) |
Adds the model and creates a parent item with given name in the aggregated model.
Definition at line 62 of file aggregatemodel.cpp.
| void Sublime::AggregateModel::removeModel | ( | QStandardItemModel * | model | ) |
The documentation for this class was generated from the following files:
KDE 4.2 API Reference