ListProxyModel Class Reference

A proxy model from tree to list. More...

#include <listproxymodel.h>

List of all members.

Public Slots

void update ()

Public Member Functions

Qt::ItemFlags flags (const QModelIndex &index) const
QVariant data (const QModelIndex &index, int role) const
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
QModelIndex parent (const QModelIndex &index) const
int rowCount (const QModelIndex &parent=QModelIndex()) const
int columnCount (const QModelIndex &parent=QModelIndex()) const
QModelIndex mapFromSource (const QModelIndex &sourceIndex) const
QModelIndex mapToSource (const QModelIndex &proxyIndex) const
void setSourceModel (QAbstractItemModel *sourceModel)

Detailed Description

A proxy model from tree to list.

This model is a implementation of the QAbstractProxyModel. For more information take a look at the QT documentation.

Authors:
Manuel Unglaub, Yves Adler

Member Function Documentation

int ListProxyModel::columnCount ( const QModelIndex &  parent = QModelIndex()  )  const

Get the number of columns.

Parameters:
parent not used.
Returns:
Because there is only one column it will return 1.
QVariant ListProxyModel::data ( const QModelIndex &  index,
int  role 
) const

Get the data of a Node specified by an index and a role.

Parameters:
index The index of the requested data.
role The rolde of the requested data.
Returns:
The data stored under the given role for the item referred to by the index.
Qt::ItemFlags ListProxyModel::flags ( const QModelIndex &  index  )  const

Get the item flags fo the given index.

Parameters:
index The index of the requested flags.
Returns:
If the index is valid a combination of the following flags: Qt::ItemIsEnabled, Qt::ItemIsSelectable.
QModelIndex ListProxyModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const

Get a specified index.

Parameters:
row The row of the requested index.
column The column of the requested index (not used).
parent The parent of the requested index (not used).
Returns:
The requested index.
QModelIndex ListProxyModel::mapFromSource ( const QModelIndex &  sourceIndex  )  const

Get the model index in the proxy model that corresponds to the sourceIndex from the source model.

Parameters:
sourceIndex The index from the source model.
Returns:
The index from the proxy model that corresponds to the sourceIndex.
See also:
mapToSource()
QModelIndex ListProxyModel::mapToSource ( const QModelIndex &  proxyIndex  )  const

Get the model index in the source model that corresponds to the proxyIndex in the proxy model.

Parameters:
proxyIndex The index from the proxy model.
Returns:
The index from the source model that corresponds to the proxyIndex.
See also:
mapFromSource()
QModelIndex ListProxyModel::parent ( const QModelIndex &  index  )  const

Get the parent of a specified index.

Parameters:
index The child of the requested index.
Returns:
The parent index of the specified index.
int ListProxyModel::rowCount ( const QModelIndex &  parent = QModelIndex()  )  const

Get the number of rows. Because this is a flat list it is the number of nodes in that list.

Parameters:
parent not used.
Returns:
The number of row.
void ListProxyModel::setSourceModel ( QAbstractItemModel *  sourceModel  ) 

Sets the given sourceModel to be processed by the proxy model.

Parameters:
sourceModel The source model that will be processed by the proxy model.
void ListProxyModel::update (  )  [slot]

Update the changes of the source model to the proxy model.


The documentation for this class was generated from the following files:
Generated on Fri May 14 19:12:51 2010 for Silence by  doxygen 1.6.3