Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > b3a1f4d91c26f535919e39e25606614a > files > 1516

wt-doc-3.2.3-1.fc18.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Wt: Wt::WAbstractItemDelegate Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Wt
   &#160;<span id="projectnumber">3.2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceWt.html">Wt</a>      </li>
      <li class="navelem"><a class="el" href="classWt_1_1WAbstractItemDelegate.html">WAbstractItemDelegate</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">Wt::WAbstractItemDelegate Class Reference<div class="ingroups"><a class="el" href="group__modelview.html">Model/view system</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="Wt::WAbstractItemDelegate" --><!-- doxytag: inherits="Wt::WObject" -->
<p>Abstract delegate class for rendering an item in an item view.  
 <a href="classWt_1_1WAbstractItemDelegate.html#details">More...</a></p>

<p><code>#include &lt;Wt/WAbstractItemDelegate&gt;</code></p>
<div class="dynheader">
Inheritance diagram for Wt::WAbstractItemDelegate:</div>
<div class="dyncontent">
<div class="center"><img src="classWt_1_1WAbstractItemDelegate__inherit__graph.png" border="0" usemap="#Wt_1_1WAbstractItemDelegate_inherit__map" alt="Inheritance graph"/></div>
<map name="Wt_1_1WAbstractItemDelegate_inherit__map" id="Wt_1_1WAbstractItemDelegate_inherit__map">
<area shape="rect" href="classWt_1_1WItemDelegate.html" title="Standard delegate class for rendering a view item." alt="" coords="29,155,165,181"/><area shape="rect" href="classWt_1_1WObject.html" title="A base class for objects that participate in the signal/slot system." alt="" coords="49,5,145,32"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="classWt_1_1WAbstractItemDelegate-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9187627f08a21042eb10443ff7b8d27f"></a><!-- doxytag: member="Wt::WAbstractItemDelegate::WAbstractItemDelegate" ref="a9187627f08a21042eb10443ff7b8d27f" args="(WObject *parent=0)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WAbstractItemDelegate.html#a9187627f08a21042eb10443ff7b8d27f">WAbstractItemDelegate</a> (<a class="el" href="classWt_1_1WObject.html">WObject</a> *parent=0)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1503db9b186ba0f21bde4852f1bcbf8a"></a><!-- doxytag: member="Wt::WAbstractItemDelegate::~WAbstractItemDelegate" ref="a1503db9b186ba0f21bde4852f1bcbf8a" args="()" -->
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WAbstractItemDelegate.html#a1503db9b186ba0f21bde4852f1bcbf8a">~WAbstractItemDelegate</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classWt_1_1WWidget.html">WWidget</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WAbstractItemDelegate.html#adc95cc43b119f4e8ebeb36a39c015fa4">update</a> (<a class="el" href="classWt_1_1WWidget.html">WWidget</a> *widget, const <a class="el" href="classWt_1_1WModelIndex.html">WModelIndex</a> &amp;index, WFlags&lt; <a class="el" href="namespaceWt.html#a8df2183a957c453839f3382e3db167d6">ViewItemRenderFlag</a> &gt; flags)=0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates or updates a widget that renders an item.  <a href="#adc95cc43b119f4e8ebeb36a39c015fa4"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WAbstractItemDelegate.html#ac5aefa0246f0fed2dcbf9493a98205c5">updateModelIndex</a> (<a class="el" href="classWt_1_1WWidget.html">WWidget</a> *widget, const <a class="el" href="classWt_1_1WModelIndex.html">WModelIndex</a> &amp;index)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the model index of a widget.  <a href="#ac5aefa0246f0fed2dcbf9493a98205c5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual boost::any&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WAbstractItemDelegate.html#aa54d70f669bd6cb7b8f90dca1f2c8c82">editState</a> (<a class="el" href="classWt_1_1WWidget.html">WWidget</a> *widget) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current edit state.  <a href="#aa54d70f669bd6cb7b8f90dca1f2c8c82"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WAbstractItemDelegate.html#aeb49d13eed388ceed70943b5c6d4cd05">setEditState</a> (<a class="el" href="classWt_1_1WWidget.html">WWidget</a> *widget, const boost::any &amp;value) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the editor data from the editor state.  <a href="#aeb49d13eed388ceed70943b5c6d4cd05"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classWt_1_1WValidator.html#a638a1feefca259ea2f806a8add2d18a3">WValidator::State</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WAbstractItemDelegate.html#a7c8d7a61e57c0478bc3ec6f66f931aad">validate</a> (const <a class="el" href="classWt_1_1WModelIndex.html">WModelIndex</a> &amp;index, const boost::any &amp;editState) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether the edited value is valid.  <a href="#a7c8d7a61e57c0478bc3ec6f66f931aad"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WAbstractItemDelegate.html#a2b4b7bc9c3782190b5b0f91f0cf83c18">setModelData</a> (const boost::any &amp;editState, <a class="el" href="classWt_1_1WAbstractItemModel.html">WAbstractItemModel</a> *model, const <a class="el" href="classWt_1_1WModelIndex.html">WModelIndex</a> &amp;index) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Saves the edited data to the model.  <a href="#a2b4b7bc9c3782190b5b0f91f0cf83c18"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classWt_1_1Signal.html">Signal</a>&lt; <a class="el" href="classWt_1_1WWidget.html">WWidget</a> *, bool &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WAbstractItemDelegate.html#a02e957cf6c1f1e9a98c6de7dbe33ff07">closeEditor</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Signal which indicates that an editor needs to be closed.  <a href="#a02e957cf6c1f1e9a98c6de7dbe33ff07"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classWt_1_1Signal.html">Signal</a>&lt; <a class="el" href="classWt_1_1WWidget.html">WWidget</a> *, bool &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WAbstractItemDelegate.html#adca0c953fa34ea4c998ec6a22865f05f">closeEditor</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Signal which indicates that an editor needs to be closed.  <a href="#adca0c953fa34ea4c998ec6a22865f05f"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Abstract delegate class for rendering an item in an item view. </p>
<p>Rendering of an item in a <a class="el" href="classWt_1_1WAbstractItemView.html" title="An abstract base class for item Views.">WAbstractItemView</a> is delegated to an implementation of this delegate class. The default implementation used by Wt's item views is <a class="el" href="classWt_1_1WItemDelegate.html" title="Standard delegate class for rendering a view item.">WItemDelegate</a>. To provide specialized rendering support, you can reimplement this class (or specialize <a class="el" href="classWt_1_1WItemDelegate.html" title="Standard delegate class for rendering a view item.">WItemDelegate</a>).</p>
<p>As a delegate is used for rendering multiple items, the class should not keep state about one specific item.</p>
<p>A delegate may provide editing support by instantiating an editor when <a class="el" href="classWt_1_1WAbstractItemDelegate.html#adc95cc43b119f4e8ebeb36a39c015fa4" title="Creates or updates a widget that renders an item.">update()</a> is called with the <a class="el" href="namespaceWt.html#a8df2183a957c453839f3382e3db167d6a30a82a0b553e55ed6cdab23a8fdadc8b" title="Render in editing mode">Wt::RenderEditing</a> flag. In that case, you will also need to implement <a class="el" href="classWt_1_1WAbstractItemDelegate.html#aa54d70f669bd6cb7b8f90dca1f2c8c82" title="Returns the current edit state.">editState()</a> and <a class="el" href="classWt_1_1WAbstractItemDelegate.html#aeb49d13eed388ceed70943b5c6d4cd05" title="Sets the editor data from the editor state.">setEditState()</a> to support virtual scrolling and <a class="el" href="classWt_1_1WAbstractItemDelegate.html#a2b4b7bc9c3782190b5b0f91f0cf83c18" title="Saves the edited data to the model.">setModelData()</a> to save the edited value to the model. For an example, see the <a class="el" href="classWt_1_1WItemDelegate.html" title="Standard delegate class for rendering a view item.">WItemDelegate</a>.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WAbstractItemView.html#a574bc36ec752012ba4a613e0e11e064e" title="Sets the delegate for a column.">WAbstractItemView::setItemDelegateForColumn()</a> </dd></dl>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a02e957cf6c1f1e9a98c6de7dbe33ff07"></a><!-- doxytag: member="Wt::WAbstractItemDelegate::closeEditor" ref="a02e957cf6c1f1e9a98c6de7dbe33ff07" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1Signal.html">Signal</a>&lt;<a class="el" href="classWt_1_1WWidget.html">WWidget</a> *, bool&gt;&amp; Wt::WAbstractItemDelegate::closeEditor </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Signal which indicates that an editor needs to be closed. </p>
<p>The delegate should emit this signal when it decides for itself that it should be closed (e.g. because the user confirmed the edited value or cancelled the editing). The View will then rerender the item if needed.</p>
<p>The second boolean argument passed to the signal is a flag which indicates whether the editor feels that the value should be saved or cancelled.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WAbstractItemView.html#a51c80c5c2d505c987047a489c960205b" title="Closes the editor for the given index.">WAbstractItemView::closeEditor()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="adca0c953fa34ea4c998ec6a22865f05f"></a><!-- doxytag: member="Wt::WAbstractItemDelegate::closeEditor" ref="adca0c953fa34ea4c998ec6a22865f05f" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classWt_1_1Signal.html">Signal</a>&lt;<a class="el" href="classWt_1_1WWidget.html">WWidget</a> *, bool&gt;&amp; Wt::WAbstractItemDelegate::closeEditor </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Signal which indicates that an editor needs to be closed. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WAbstractItemDelegate.html#a02e957cf6c1f1e9a98c6de7dbe33ff07" title="Signal which indicates that an editor needs to be closed.">closeEditor()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="aa54d70f669bd6cb7b8f90dca1f2c8c82"></a><!-- doxytag: member="Wt::WAbstractItemDelegate::editState" ref="aa54d70f669bd6cb7b8f90dca1f2c8c82" args="(WWidget *widget) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boost::any Wt::WAbstractItemDelegate::editState </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classWt_1_1WWidget.html">WWidget</a> *&#160;</td>
          <td class="paramname"><em>widget</em></td><td>)</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the current edit state. </p>
<p>Because a View may support virtual scrolling in combination with editing, it may happen that the view decides to delete the editor widget while the user is editing. To allow to reconstruct the editor in its original state, the View will therefore ask for the editor to serialize its state in a boost::any.</p>
<p>When the view decides to close an editor and save its value back to the model, he will first call <a class="el" href="classWt_1_1WAbstractItemDelegate.html#aa54d70f669bd6cb7b8f90dca1f2c8c82" title="Returns the current edit state.">editState()</a> and then <a class="el" href="classWt_1_1WAbstractItemDelegate.html#a2b4b7bc9c3782190b5b0f91f0cf83c18" title="Saves the edited data to the model.">setModelData()</a>.</p>
<p>The default implementation assumes a read-only delegate, and returns a boost::any().</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WAbstractItemDelegate.html#aeb49d13eed388ceed70943b5c6d4cd05" title="Sets the editor data from the editor state.">setEditState()</a>, <a class="el" href="classWt_1_1WAbstractItemDelegate.html#a2b4b7bc9c3782190b5b0f91f0cf83c18" title="Saves the edited data to the model.">setModelData()</a> </dd></dl>

<p>Reimplemented in <a class="el" href="classWt_1_1WItemDelegate.html#a4efa5822211a5791df55d2d464a5cd4e">Wt::WItemDelegate</a>.</p>

</div>
</div>
<a class="anchor" id="aeb49d13eed388ceed70943b5c6d4cd05"></a><!-- doxytag: member="Wt::WAbstractItemDelegate::setEditState" ref="aeb49d13eed388ceed70943b5c6d4cd05" args="(WWidget *widget, const boost::any &amp;value) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WAbstractItemDelegate::setEditState </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classWt_1_1WWidget.html">WWidget</a> *&#160;</td>
          <td class="paramname"><em>widget</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const boost::any &amp;&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Sets the editor data from the editor state. </p>
<p>When the View scrolls back into view an item that was being edited, he will use <a class="el" href="classWt_1_1WAbstractItemDelegate.html#aeb49d13eed388ceed70943b5c6d4cd05" title="Sets the editor data from the editor state.">setEditState()</a> to allow the editor to restore its current editor state.</p>
<p>The default implementation assumes a read-only delegate and does nothing.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WAbstractItemDelegate.html#aa54d70f669bd6cb7b8f90dca1f2c8c82" title="Returns the current edit state.">editState()</a> </dd></dl>

<p>Reimplemented in <a class="el" href="classWt_1_1WItemDelegate.html#afacb5ea1866c2212ad3cf0a616c78857">Wt::WItemDelegate</a>.</p>

</div>
</div>
<a class="anchor" id="a2b4b7bc9c3782190b5b0f91f0cf83c18"></a><!-- doxytag: member="Wt::WAbstractItemDelegate::setModelData" ref="a2b4b7bc9c3782190b5b0f91f0cf83c18" args="(const boost::any &amp;editState, WAbstractItemModel *model, const WModelIndex &amp;index) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WAbstractItemDelegate::setModelData </td>
          <td>(</td>
          <td class="paramtype">const boost::any &amp;&#160;</td>
          <td class="paramname"><em>editState</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classWt_1_1WAbstractItemModel.html">WAbstractItemModel</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classWt_1_1WModelIndex.html">WModelIndex</a> &amp;&#160;</td>
          <td class="paramname"><em>index</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Saves the edited data to the model. </p>
<p>The View will use this method to save the edited value to the model. The <code>editState</code> is first fetched from the editor using <a class="el" href="classWt_1_1WAbstractItemDelegate.html#aa54d70f669bd6cb7b8f90dca1f2c8c82" title="Returns the current edit state.">editState()</a>.</p>
<p>The default implementation assumes a read-only delegate does nothing. </p>

<p>Reimplemented in <a class="el" href="classWt_1_1WItemDelegate.html#a7f5f6ee8d506749f9e16463c5502f0f2">Wt::WItemDelegate</a>.</p>

</div>
</div>
<a class="anchor" id="adc95cc43b119f4e8ebeb36a39c015fa4"></a><!-- doxytag: member="Wt::WAbstractItemDelegate::update" ref="adc95cc43b119f4e8ebeb36a39c015fa4" args="(WWidget *widget, const WModelIndex &amp;index, WFlags&lt; ViewItemRenderFlag &gt; flags)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classWt_1_1WWidget.html">WWidget</a>* Wt::WAbstractItemDelegate::update </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classWt_1_1WWidget.html">WWidget</a> *&#160;</td>
          <td class="paramname"><em>widget</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classWt_1_1WModelIndex.html">WModelIndex</a> &amp;&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">WFlags&lt; <a class="el" href="namespaceWt.html#a8df2183a957c453839f3382e3db167d6">ViewItemRenderFlag</a> &gt;&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates or updates a widget that renders an item. </p>
<p>The item is specified by its model <code>index</code>, which also indicates the model. If an existing widget already renders the item, but needs to be updated, it is passed as the <code>widget</code> parameter. You may decide to create a new widget, in which case you are responsible to delete the previous <code>widget</code> if it is not reused.</p>
<p>When <code>widget</code> is <code>0</code>, a new widget needs to be created.</p>
<p>The returned widget should be a widget that responds properly to be given a height, width and style class. In practice, that means it cannot have a border or margin, and thus cannot be a <a class="el" href="classWt_1_1WFormWidget.html" title="An abstract widget that corresponds to an HTML form element.">WFormWidget</a> since those widgets typically have built-in borders and margins. If you want to return a form widget (for editing the item), you should wrap it in a container widget.</p>
<p>The <code>flags</code> parameter indicates options for rendering the item. </p>

<p>Implemented in <a class="el" href="classWt_1_1WItemDelegate.html#a2cbc2240449a1000650f3c3b5e64bc8f">Wt::WItemDelegate</a>.</p>

</div>
</div>
<a class="anchor" id="ac5aefa0246f0fed2dcbf9493a98205c5"></a><!-- doxytag: member="Wt::WAbstractItemDelegate::updateModelIndex" ref="ac5aefa0246f0fed2dcbf9493a98205c5" args="(WWidget *widget, const WModelIndex &amp;index)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WAbstractItemDelegate::updateModelIndex </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classWt_1_1WWidget.html">WWidget</a> *&#160;</td>
          <td class="paramname"><em>widget</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classWt_1_1WModelIndex.html">WModelIndex</a> &amp;&#160;</td>
          <td class="paramname"><em>index</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Updates the model index of a widget. </p>
<p>This method is invoked by the view when due to row/column insertions or removals, the index has shifted.</p>
<p>You should reimplement this method only if you are storing the model index in the <code>widget</code>, to update the stored model index.</p>
<p>The default implementation does nothing. </p>

<p>Reimplemented in <a class="el" href="classWt_1_1WItemDelegate.html#a8d97be988b846205f61b646c3a424040">Wt::WItemDelegate</a>.</p>

</div>
</div>
<a class="anchor" id="a7c8d7a61e57c0478bc3ec6f66f931aad"></a><!-- doxytag: member="Wt::WAbstractItemDelegate::validate" ref="a7c8d7a61e57c0478bc3ec6f66f931aad" args="(const WModelIndex &amp;index, const boost::any &amp;editState) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1WValidator.html#a638a1feefca259ea2f806a8add2d18a3">WValidator::State</a> Wt::WAbstractItemDelegate::validate </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classWt_1_1WModelIndex.html">WModelIndex</a> &amp;&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const boost::any &amp;&#160;</td>
          <td class="paramname"><em>editState</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns whether the edited value is valid. </p>
<p>The default implementation does nothing and returns Valid.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WValidator.html#a78808215d68944dedca11ff8889374ed" title="Validates the given input.">WValidator::validate()</a> </dd></dl>

</div>
</div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr size="1"><address style="text-align: right; margin: 3px"><small>
Generated on Thu Nov 1 2012 for <a href="http://www.webtoolkit.eu/wt">the
C++ Web Toolkit (Wt)</a> by&nbsp;<a
href="http://www.doxygen.org/index.html"><img src="doxygen.png"
alt="doxygen" border="0" style="vertical-align: middle; display:
inline-block; height: 2em"></a> 1.7.5.1</small></address>
</body>
</html>