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

Standard delegate class for rendering a view item. More...

#include <Wt/WItemDelegate>

Inheritance diagram for Wt::WItemDelegate:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual WWidgetupdate (WWidget *widget, const WModelIndex &index, WFlags< ViewItemRenderFlag > flags)
 Create or update a widget that renders an item.
virtual void updateModelIndex (WWidget *widget, const WModelIndex &index)
 Update the model index of a widget.
void setTextFormat (const WString &format)
 Set the text format string.
const WStringtextFormat () const
 Returns the text format string.


Detailed Description

Standard delegate class for rendering a view item.

This class provides the standard implementation for rendering an item in a WTreeView.


Member Function Documentation

WWidget * Wt::WItemDelegate::update ( WWidget widget,
const WModelIndex index,
WFlags< ViewItemRenderFlag flags 
) [virtual]

Create or update a widget that renders an item.

The item is specified by its model index, which also indicates the model. If an existing widget already renders the item, but needs to be updated, it is passed as the widget parameter. You may decide to create a new widget, in which case you are responsible to delete the previous widget if it is not reused.

When widget is null, a new widget needs to be created.

The flags parameter indicates options for rendering the item.

Implements Wt::WAbstractItemDelegate.

void Wt::WItemDelegate::updateModelIndex ( WWidget widget,
const WModelIndex index 
) [virtual]

Update the model index of a widget.

This method is invoked by the view when due to row/column insertions or removals, an index was modified for a widget.

You should reimplement this method if you are storing the model index (e.g. for editing purposes) in the widget, which you should update to the new index.

The default implementation does nothing.

Reimplemented from Wt::WAbstractItemDelegate.

void Wt::WItemDelegate::setTextFormat ( const WString format  ) 

Set the text format string.

The DisplayRole data is converted to a string using asString() by passing the given format.

The default value is "".

const WString& Wt::WItemDelegate::textFormat (  )  const [inline]

Returns the text format string.

See also:
setTextFormat()


Generated on Tue Sep 1 17:51:16 2009 for Wt by doxygen 1.5.6