A container widget which provides a view implementation of a WTable. More...
#include <Wt/WTableView>
Inherits Wt::WCompositeWidget.
Public Member Functions | |
WTableView (WContainerWidget *parent=0) | |
Constructor. | |
virtual | ~WTableView () |
Destructor. | |
void | setModel (WAbstractItemModel *model) |
Sets the model. | |
void | setItemDelegate (WAbstractItemDelegate *delegate) |
Sets the default item delegate. | |
WAbstractItemDelegate * | itemDelegate () const |
Returns the default item delegate. | |
void | setItemDelegateForColumn (int column, WAbstractItemDelegate *delegate) |
Sets the delegate for a column. | |
WAbstractItemDelegate * | itemDelegateForColumn (int column) const |
Returns the delegate for a column. | |
WAbstractItemDelegate * | itemDelegate (const WModelIndex &index) const |
Returns the delegate for rendering an item. | |
Protected Member Functions | |
WTable * | table () |
Returns the table used for rendering the model. |
A container widget which provides a view implementation of a WTable.
The WTableView operates on a WAbstractItemModel provided via setModel(). Data in the model is rendered using an HTML <table>
, and the model reacts to any model changes. You may use CSS stylesheets for <table>
, <tr>
, and <td>
elements to provide style to the table.
<table>
element will still be used. WAbstractItemDelegate* Wt::WTableView::itemDelegate | ( | ) | const [inline] |
Returns the default item delegate.
WAbstractItemDelegate * Wt::WTableView::itemDelegate | ( | const WModelIndex & | index | ) | const |
Returns the delegate for rendering an item.
WAbstractItemDelegate * Wt::WTableView::itemDelegateForColumn | ( | int | column | ) | const |
Returns the delegate for a column.
void Wt::WTableView::setItemDelegate | ( | WAbstractItemDelegate * | delegate | ) |
Sets the default item delegate.
The previous delegate is removed but not deleted.
The default item delegate is a WItemDelegate.
void Wt::WTableView::setItemDelegateForColumn | ( | int | column, | |
WAbstractItemDelegate * | delegate | |||
) |
Sets the delegate for a column.
The previous delegate is removed but not deleted.
void Wt::WTableView::setModel | ( | WAbstractItemModel * | model | ) |
Sets the model.
If a previous model was set, it is not deleted.