<class name="QAbstractItemDelegate" doc="/**
&lt;p&gt;The &lt;a href=&quot;QAbstractItemDelegate.html#QAbstractItemDelegate(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractItemDelegate&lt;/tt&gt;&lt;/a&gt; class is used to display and edit data items from a model.&lt;/p&gt;
&lt;p&gt;A &lt;a href=&quot;QAbstractItemDelegate.html#QAbstractItemDelegate(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractItemDelegate&lt;/tt&gt;&lt;/a&gt; provides the interface and common functionality for delegates in the model/view architecture. Delegates display individual items in views, and handle the editing of model data.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;QAbstractItemDelegate.html#QAbstractItemDelegate(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractItemDelegate&lt;/tt&gt;&lt;/a&gt; class is one of the &lt;a href=&quot;%2E%2E/qt4-interview.html#model-view-classes&quot;&gt;Model/View Classes&lt;/tt&gt;&lt;/a&gt; and is part of Qt's &lt;a href=&quot;%2E%2E/model-view-programming.html&quot;&gt;model/view framework&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To render an item in a custom way, you must implement &lt;a href=&quot;QAbstractItemDelegate.html#paint(com.trolltech.qt.gui.QPainter, com.trolltech.qt.gui.QStyleOptionViewItem, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;paint&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QAbstractItemDelegate.html#sizeHint(com.trolltech.qt.gui.QStyleOptionViewItem, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;sizeHint&lt;/tt&gt;&lt;/a&gt;. The &lt;a href=&quot;QItemDelegate.html&quot;&gt;&lt;tt&gt;QItemDelegate&lt;/tt&gt;&lt;/a&gt; class provides default implementations for these functions; if you do not need custom rendering, subclass that class instead.&lt;/p&gt;
&lt;p&gt;To provide custom editing, there are two approaches that can be used. The first approach is to create an editor widget and display it directly on top of the item. To do this you must reimplement &lt;a href=&quot;QAbstractItemDelegate.html#createEditor(com.trolltech.qt.gui.QWidget, com.trolltech.qt.gui.QStyleOptionViewItem, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;createEditor&lt;/tt&gt;&lt;/a&gt; to provide an editor widget, &lt;a href=&quot;QAbstractItemDelegate.html#setEditorData(com.trolltech.qt.gui.QWidget, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;setEditorData&lt;/tt&gt;&lt;/a&gt; to populate the editor with the data from the model, and &lt;a href=&quot;QAbstractItemDelegate.html#setModelData(com.trolltech.qt.gui.QWidget, com.trolltech.qt.core.QAbstractItemModel, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;setModelData&lt;/tt&gt;&lt;/a&gt; so that the delegate can update the model with data from the editor.&lt;/p&gt;
&lt;p&gt;The second approach is to handle user events directly by reimplementing &lt;a href=&quot;QAbstractItemDelegate.html#editorEvent(com.trolltech.qt.core.QEvent, com.trolltech.qt.core.QAbstractItemModel, com.trolltech.qt.gui.QStyleOptionViewItem, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;editorEvent&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;

@see &lt;a href=&quot;%2E%2E/model-view-programming.html&quot;&gt;Model/View Programming&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QItemDelegate.html&quot;&gt;&lt;tt&gt;QItemDelegate&lt;/tt&gt;&lt;/a&gt;
@see Pixelator Example&lt;/tt&gt; */">
    <signal name="protected final void closeEditor(com.trolltech.qt.gui.QWidget editor, com.trolltech.qt.gui.QAbstractItemDelegate.EndEditHint hint)" doc="/**
&lt;p&gt;This signal is emitted when the user has finished editing an item using the specified &lt;tt&gt;editor&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;tt&gt;hint&lt;/tt&gt; provides a way for the delegate to influence how the model and view behave after editing is completed. It indicates to these components what action should be performed next to provide a comfortable editing experience for the user. For example, if &lt;tt&gt;EditNextItem&lt;/tt&gt; is specified, the view should use a delegate to open an editor on the next item in the model.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(com.trolltech.qt.gui.QWidget editor, com.trolltech.qt.gui.QAbstractItemDelegate.EndEditHint hint)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(com.trolltech.qt.gui.QWidget editor)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QAbstractItemDelegate.html#EndEditHint-enum&quot;&gt;&lt;tt&gt;EndEditHint&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void commitData(com.trolltech.qt.gui.QWidget editor)" doc="/**
&lt;p&gt;This signal must be emitted when the &lt;tt&gt;editor&lt;/tt&gt; widget has completed editing the data, and wants to write it back into the model.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(com.trolltech.qt.gui.QWidget editor)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <method name="public QAbstractItemDelegate(com.trolltech.qt.core.QObject parent)" doc="/**
&lt;p&gt;Creates a new abstract item delegate with the given &lt;tt&gt;parent&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="public QAbstractItemDelegate()" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QAbstractItemDelegate.html#QAbstractItemDelegate(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractItemDelegate&lt;/tt&gt;&lt;/a&gt;(0). */"/>
    <method name="public final boolean helpEvent(com.trolltech.qt.gui.QHelpEvent event, com.trolltech.qt.gui.QAbstractItemView view, com.trolltech.qt.gui.QStyleOptionViewItem option, com.trolltech.qt.core.QModelIndex index)" doc="/**
&lt;p&gt;Whenever a help event occurs, this function is called with the &lt;tt&gt;event&lt;/tt&gt; &lt;tt&gt;view&lt;/tt&gt; &lt;tt&gt;option&lt;/tt&gt; and the &lt;tt&gt;index&lt;/tt&gt; that corresponds to the item where the event occurs.&lt;/p&gt;
&lt;p&gt;Returns true if the delegate can handle the event; otherwise returns false. A return value of true indicates that the data obtained using the index had the required role.&lt;/p&gt;
&lt;p&gt;For QEvent::ToolTip and QEvent::WhatsThis events that were handled successfully, the relevant popup may be shown depending on the user's system configuration.&lt;/p&gt;

@see &lt;a href=&quot;QHelpEvent.html&quot;&gt;&lt;tt&gt;QHelpEvent&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public com.trolltech.qt.gui.QWidget createEditor(com.trolltech.qt.gui.QWidget parent, com.trolltech.qt.gui.QStyleOptionViewItem option, com.trolltech.qt.core.QModelIndex index)" doc="/**
&lt;p&gt;Returns the editor to be used for editing the data item with the given &lt;tt&gt;index&lt;/tt&gt;. Note that the index contains information about the model being used. The editor's parent widget is specified by &lt;tt&gt;parent&lt;/tt&gt;, and the item options by &lt;tt&gt;option&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;The base implementation returns 0. If you want custom editing you will need to reimplement this function.&lt;/p&gt;
&lt;p&gt;The returned editor widget should have Qt::StrongFocus; otherwise, &lt;a href=&quot;QMouseEvent.html&quot;&gt;&lt;tt&gt;QMouseEvent&lt;/tt&gt;&lt;/a&gt;s received by the widget will propagate to the view. The view's background will shine through unless the editor paints its own background (e.g&amp;#x2e;, with setAutoFillBackground()).&lt;/p&gt;

@see &lt;a href=&quot;QAbstractItemDelegate.html#setModelData(com.trolltech.qt.gui.QWidget, com.trolltech.qt.core.QAbstractItemModel, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;setModelData&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QAbstractItemDelegate.html#setEditorData(com.trolltech.qt.gui.QWidget, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;setEditorData&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public boolean editorEvent(com.trolltech.qt.core.QEvent event, com.trolltech.qt.core.QAbstractItemModel model, com.trolltech.qt.gui.QStyleOptionViewItem option, com.trolltech.qt.core.QModelIndex index)" doc="/**
&lt;p&gt;Whenever an event occurs, this function is called with the &lt;tt&gt;event&lt;/tt&gt; &lt;tt&gt;model&lt;/tt&gt; &lt;tt&gt;option&lt;/tt&gt; and the &lt;tt&gt;index&lt;/tt&gt; that corresponds to the item being edited.&lt;/p&gt;
&lt;p&gt;The base implementation returns false (indicating that it has not handled the event).&lt;/p&gt;
 */"/>
    <method name="public abstract void paint(com.trolltech.qt.gui.QPainter painter, com.trolltech.qt.gui.QStyleOptionViewItem option, com.trolltech.qt.core.QModelIndex index)" doc="/**
&lt;p&gt;This pure abstract function must be reimplemented if you want to provide custom rendering. Use the &lt;tt&gt;painter&lt;/tt&gt; and style &lt;tt&gt;option&lt;/tt&gt; to render the item specified by the item &lt;tt&gt;index&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;If you reimplement this you must also reimplement &lt;a href=&quot;QAbstractItemDelegate.html#sizeHint(com.trolltech.qt.gui.QStyleOptionViewItem, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;sizeHint&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
 */"/>
    <method name="public void setEditorData(com.trolltech.qt.gui.QWidget editor, com.trolltech.qt.core.QModelIndex index)" doc="/**
&lt;p&gt;Sets the contents of the given &lt;tt&gt;editor&lt;/tt&gt; to the data for the item at the given &lt;tt&gt;index&lt;/tt&gt;. Note that the index contains information about the model being used.&lt;/p&gt;
&lt;p&gt;The base implementation does nothing. If you want custom editing you will need to reimplement this function.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractItemDelegate.html#setModelData(com.trolltech.qt.gui.QWidget, com.trolltech.qt.core.QAbstractItemModel, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;setModelData&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public void setModelData(com.trolltech.qt.gui.QWidget editor, com.trolltech.qt.core.QAbstractItemModel model, com.trolltech.qt.core.QModelIndex index)" doc="/**
&lt;p&gt;Sets the data for the item at the given &lt;tt&gt;index&lt;/tt&gt; in the &lt;tt&gt;model&lt;/tt&gt; to the contents of the given &lt;tt&gt;editor&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;The base implementation does nothing. If you want custom editing you will need to reimplement this function.&lt;/p&gt;

@see &lt;a href=&quot;QAbstractItemDelegate.html#setEditorData(com.trolltech.qt.gui.QWidget, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;setEditorData&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public abstract com.trolltech.qt.core.QSize sizeHint(com.trolltech.qt.gui.QStyleOptionViewItem option, com.trolltech.qt.core.QModelIndex index)" doc="/**
&lt;p&gt;This pure abstract function must be reimplemented if you want to provide custom rendering. The options are specified by &lt;tt&gt;option&lt;/tt&gt; and the model item by &lt;tt&gt;index&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;If you reimplement this you must also reimplement &lt;a href=&quot;QAbstractItemDelegate.html#paint(com.trolltech.qt.gui.QPainter, com.trolltech.qt.gui.QStyleOptionViewItem, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;paint&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
 */"/>
    <method name="public void updateEditorGeometry(com.trolltech.qt.gui.QWidget editor, com.trolltech.qt.gui.QStyleOptionViewItem option, com.trolltech.qt.core.QModelIndex index)" doc="/**
&lt;p&gt;Updates the geometry of the &lt;tt&gt;editor&lt;/tt&gt; for the item with the given &lt;tt&gt;index&lt;/tt&gt;, according to the rectangle specified in the &lt;tt&gt;option&lt;/tt&gt;. If the item has an internal layout, the editor will be laid out accordingly. Note that the index contains information about the model being used.&lt;/p&gt;
&lt;p&gt;The base implementation does nothing. If you want custom editing you must reimplement this function.&lt;/p&gt;
 */"/>
    <enum name="EndEditHint" doc="/**
&lt;p&gt;This enum describes the different hints that the delegate can give to the model and view components to make editing data in a model a comfortable experience for the user.&lt;/p&gt;
&lt;p&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; width=&quot;100%&quot;&gt;
&lt;tr&gt;&lt;th width=&quot;25%&quot;&gt;Constant&lt;/th&gt;&lt;th width=&quot;15%&quot;&gt;Value&lt;/th&gt;&lt;th width=&quot;60%&quot;&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;&lt;tt&gt;NoHint&lt;/tt&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; valign=&quot;top&quot;&gt;&lt;tt&gt;0&lt;/tt&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;There is no recommended action to be performed.&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;These hints let the delegate influence the behavior of the view:&lt;/p&gt;
&lt;p&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; width=&quot;100%&quot;&gt;
&lt;tr&gt;&lt;th width=&quot;25%&quot;&gt;Constant&lt;/th&gt;&lt;th width=&quot;15%&quot;&gt;Value&lt;/th&gt;&lt;th width=&quot;60%&quot;&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;&lt;tt&gt;EditNextItem&lt;/tt&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; valign=&quot;top&quot;&gt;&lt;tt&gt;1&lt;/tt&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;The view should use the delegate to open an editor on the next item in the view.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;&lt;tt&gt;EditPreviousItem&lt;/tt&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; valign=&quot;top&quot;&gt;&lt;tt&gt;2&lt;/tt&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;The view should use the delegate to open an editor on the previous item in the view.&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;Note that custom views may interpret the concepts of next and previous differently.&lt;/p&gt;
&lt;p&gt;The following hints are most useful when models are used that cache data, such as those that manipulate date locally in order to increase performance or conserve network bandwidth.&lt;/p&gt;
&lt;p&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; width=&quot;100%&quot;&gt;
&lt;tr&gt;&lt;th width=&quot;25%&quot;&gt;Constant&lt;/th&gt;&lt;th width=&quot;15%&quot;&gt;Value&lt;/th&gt;&lt;th width=&quot;60%&quot;&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;&lt;tt&gt;SubmitModelCache&lt;/tt&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; valign=&quot;top&quot;&gt;&lt;tt&gt;3&lt;/tt&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;If the model caches data, it should write out cached data to the underlying data store.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;&lt;tt&gt;RevertModelCache&lt;/tt&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; valign=&quot;top&quot;&gt;&lt;tt&gt;4&lt;/tt&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;If the model caches data, it should discard cached data and replace it with data from the underlying data store.&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;Although models and views should respond to these hints in appropriate ways, custom components may ignore any or all of them if they are not relevant.&lt;/p&gt;
 */">
        <enum-value name="NoHint" doc="/**
&lt;p&gt;There is no recommended action to be performed.&lt;/p&gt;
 */"/>
        <enum-value name="EditNextItem" doc="/**
&lt;p&gt;The view should use the delegate to open an editor on the next item in the view.&lt;/p&gt;
 */"/>
        <enum-value name="EditPreviousItem" doc="/**
&lt;p&gt;The view should use the delegate to open an editor on the previous item in the view.&lt;/p&gt;
 */"/>
        <enum-value name="SubmitModelCache" doc="/**
&lt;p&gt;If the model caches data, it should write out cached data to the underlying data store.&lt;/p&gt;
 */"/>
        <enum-value name="RevertModelCache" doc="/**
&lt;p&gt;If the model caches data, it should discard cached data and replace it with data from the underlying data store.&lt;/p&gt;
 */"/>
</enum>
</class>
