Wt::WAbstractListModel Class Reference
[Model/view system]

An abstract list model for use with Wt's view classes. More...

#include <Wt/WAbstractListModel>

Inheritance diagram for Wt::WAbstractListModel:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 WAbstractListModel (WObject *parent=0)
 Create a new abstract list model.
 ~WAbstractListModel ()
 Destructor.
virtual WModelIndex parent (const WModelIndex &index) const
 Returns the parent for a model index.
virtual WModelIndex index (int row, int column, const WModelIndex &parent=WModelIndex()) const
 Returns the child index for the given row and column.
virtual int columnCount (const WModelIndex &parent=WModelIndex()) const
 Returns the number of columns.


Detailed Description

An abstract list model for use with Wt's view classes.

An abstract list model specializes WAbstractItemModel for one-dimensional lists (i.e. a model with 1 column and no children).

It cannot be used directly but must be subclassed. Subclassed models must at least reimplement rowCount() to return the number of rows, and data() to return data.


Member Function Documentation

WModelIndex Wt::WAbstractListModel::parent ( const WModelIndex index  )  const [virtual]

Returns the parent for a model index.

You should use createIndex() to create a model index that corresponds to the parent of a given index.

See also:
index()

Implements Wt::WAbstractItemModel.

WModelIndex Wt::WAbstractListModel::index ( int  row,
int  column,
const WModelIndex parent = WModelIndex() 
) const [virtual]

Returns the child index for the given row and column.

When implementing this method, you can use createIndex() to create an index that corresponds to the item at row and column within parent.

If the location is invalid (out of bounds at the parent), then an invalid index must be returned.

See also:
parent()

Implements Wt::WAbstractItemModel.

int Wt::WAbstractListModel::columnCount ( const WModelIndex parent = WModelIndex()  )  const [virtual]

Returns the number of columns.

This returns the number of columns at index parent.

See also:
rowCount()

Implements Wt::WAbstractItemModel.


Generated on Mon Jan 26 14:14:05 2009 for Wt by doxygen 1.5.6