• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • KDevelop Platform Libraries
  • Sitemap
  • Contact Us
 

sublime

Sublime::AggregateModel

Sublime::AggregateModel Class Reference

#include <aggregatemodel.h>

Inheritance diagram for Sublime::AggregateModel:

Inheritance graph
[legend]

List of all members.


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
Coffee Model:
- Arabica
- Robusta

When aggregated with

    AggregateModel model;
    model->addModel("Tea", teaModel);
    model->addModel("Coffee", coffeeModel);
they will look as:
- 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  ) 

Removes the model from aggregation.

Definition at line 69 of file aggregatemodel.cpp.


The documentation for this class was generated from the following files:
  • aggregatemodel.h
  • aggregatemodel.cpp

sublime

Skip menu "sublime"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

KDevelop Platform Libraries

Skip menu "KDevelop Platform Libraries"
  • interfaces
  • language
  •   duchain
  •   editor
  • outputview
  • project
  • shell
  • sublime
  • util
  • vcs
Generated for KDevelop Platform Libraries by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal