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

A class that represents a selection for a WAbstractItemView. More...

#include <Wt/WItemSelectionModel>

Inherits Wt::WObject.

List of all members.

Public Member Functions

WAbstractItemModelmodel () const
 Returns the WAbstractItemModel.
WModelIndexSet selectedIndexes () const
 Returns the set of selected items.
bool isSelected (const WModelIndex &index) const
 Returns wheter an item is selected.
void setSelectionBehavior (SelectionBehavior behavior)
 Sets the selection behaviour.
SelectionBehavior selectionBehavior () const
 Returns the selection behaviour.

Detailed Description

A class that represents a selection for a WAbstractItemView.

This model is currently only used by WTreeView, and plays only a role in drag & drop of an item selection.

When an item selection is dragged from a view widget, the generated drop events will have as source object (see WDropEvent::source()) this selection model.

Although this class does not (yet) allow you to modify the selection, note that manipulations to the model may modify the selection (row insertions and removals may shift the selection, and row deletions may shrink the selection).

Note:
Currently this class cannot be shared between multiple views.
See also:
WTreeView, WAbstractItemModel

Member Function Documentation

bool Wt::WItemSelectionModel::isSelected ( const WModelIndex index  )  const

Returns wheter an item is selected.

See also:
selectedIndexes()
WModelIndexSet Wt::WItemSelectionModel::selectedIndexes (  )  const [inline]

Returns the set of selected items.

The model indexes are returned as a set, topologically ordered (in the order they appear in the view).

SelectionBehavior Wt::WItemSelectionModel::selectionBehavior (  )  const [inline]

Returns the selection behaviour.

See also:
setSelectionBehavior()
void Wt::WItemSelectionModel::setSelectionBehavior ( SelectionBehavior  behavior  ) 

Sets the selection behaviour.

By default, the selection contains rows (SelectRows), in which case model indexes will always be have column 0, but represent the whole row.

Alternatively, you can allow selection for individual items (SelectItems).


Generated on Thu May 13 05:16:16 2010 for Wt by doxygen 1.6.3