Public Member Functions

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

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

#include <Wt/WItemDelegate>

Inherits Wt::WAbstractItemDelegate.

List of all members.

Public Member Functions

 WItemDelegate (WObject *parent=0)
 Create an item delegate.
virtual WWidgetupdate (WWidget *widget, const WModelIndex &index, WFlags< ViewItemRenderFlag > flags)
 Creates or updates a widget that renders an item.
virtual void updateModelIndex (WWidget *widget, const WModelIndex &index)
 Updates the model index of a widget.
void setTextFormat (const WString &format)
 Sets 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

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

Sets 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()
WWidget * Wt::WItemDelegate::update ( WWidget widget,
const WModelIndex index,
WFlags< ViewItemRenderFlag flags 
) [virtual]

Creates or updates 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 0, 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]

Updates 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.


Generated on Mon Nov 29 2010 08:03:19 for Wt by doxygen 1.7.1