<class name="QItemDelegate" doc="/**
&lt;p&gt;The &lt;a href=&quot;QItemDelegate.html#QItemDelegate(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QItemDelegate&lt;/tt&gt;&lt;/a&gt; class provides display and editing facilities for data items from a model.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QItemDelegate.html#QItemDelegate(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QItemDelegate&lt;/tt&gt;&lt;/a&gt; can be used to provide custom display features and editor widgets for item views based on &lt;a href=&quot;QAbstractItemView.html&quot;&gt;&lt;tt&gt;QAbstractItemView&lt;/tt&gt;&lt;/a&gt; subclasses. Using a delegate for this purpose allows the display and editing mechanisms to be customized and developed independently from the model and view.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;QItemDelegate.html#QItemDelegate(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QItemDelegate&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;When displaying items from a custom model in a standard view, it is often sufficient to simply ensure that the model returns appropriate data for each of the roles&lt;/tt&gt; that determine the appearance of items in views. The default delegate used by Qt's standard views uses this role information to display items in most of the common forms expected by users. However, it is sometimes necessary to have even more control over the appearance of items than the default delegate can provide.&lt;/p&gt;
&lt;p&gt;This class provides default implementations of the functions for painting item data in a view and editing data from item models. Default implementations of the &lt;a href=&quot;QItemDelegate.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;QItemDelegate.html#sizeHint(com.trolltech.qt.gui.QStyleOptionViewItem, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;sizeHint&lt;/tt&gt;&lt;/a&gt; virtual functions, defined in &lt;a href=&quot;QAbstractItemDelegate.html#QAbstractItemDelegate(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractItemDelegate&lt;/tt&gt;&lt;/a&gt;, are provided to ensure that the delegate implements the correct basic behavior expected by views. You can reimplement these functions in subclasses to customize the appearance of items.&lt;/p&gt;
&lt;p&gt;When editing data in an item view, &lt;a href=&quot;QItemDelegate.html#QItemDelegate(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QItemDelegate&lt;/tt&gt;&lt;/a&gt; provides an editor widget, which is a widget that is placed on top of the view while editing takes place. Editors are created with a &lt;a href=&quot;QItemEditorFactory.html&quot;&gt;&lt;tt&gt;QItemEditorFactory&lt;/tt&gt;&lt;/a&gt;; a default static instance provided by &lt;a href=&quot;QItemEditorFactory.html&quot;&gt;&lt;tt&gt;QItemEditorFactory&lt;/tt&gt;&lt;/a&gt; is installed on all item delagates. You can set a custom factory using &lt;a href=&quot;QItemDelegate.html#setItemEditorFactory(com.trolltech.qt.gui.QItemEditorFactory)&quot;&gt;&lt;tt&gt;setItemEditorFactory&lt;/tt&gt;&lt;/a&gt; or set a new default factory with QItemEditorFactory::setDefaultFactory(). It is the data stored in the item model with the Qt::EditRole that is edited.&lt;/p&gt;
&lt;p&gt;Only the standard editing functions for widget-based delegates are reimplemented here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;QItemDelegate.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; returns the widget used to change data from the model and can be reimplemented to customize editing behavior.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;QItemDelegate.html#setEditorData(com.trolltech.qt.gui.QWidget, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;setEditorData&lt;/tt&gt;&lt;/a&gt; provides the widget with data to manipulate.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;QItemDelegate.html#updateEditorGeometry(com.trolltech.qt.gui.QWidget, com.trolltech.qt.gui.QStyleOptionViewItem, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;updateEditorGeometry&lt;/tt&gt;&lt;/a&gt; ensures that the editor is displayed correctly with respect to the item view.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;QItemDelegate.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; returns updated data to the model.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;a href=&quot;QItemDelegate.html#closeEditor(com.trolltech.qt.gui.QWidget, com.trolltech.qt.gui.QAbstractItemDelegate.EndEditHint)&quot;&gt;&lt;tt&gt;closeEditor&lt;/tt&gt;&lt;/a&gt; signal indicates that the user has completed editing the data, and that the editor widget can be destroyed.&lt;/p&gt;
&lt;a name=&quot;standard-roles-and-data-types&quot;&gt;&lt;/a&gt;
&lt;h3&gt;Standard Roles and Data Types&lt;/h3&gt;
&lt;p&gt;The default delegate used by the standard views supplied with Qt associates each standard role (defined by Qt::ItemDataRole) with certain data types. Models that return data in these types can influence the appearance of the delegate as described in the following table.&lt;/p&gt;
&lt;p&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; border=&quot;0&quot;&gt;
&lt;thead&gt;&lt;tr valign=&quot;top&quot; class=&quot;qt-style&quot;&gt;&lt;th&gt;Role&lt;/th&gt;&lt;th&gt;Accepted Types&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;&lt;tt&gt;Qt::BackgroundRole&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;QBrush.html&quot;&gt;&lt;tt&gt;QBrush&lt;/tt&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;even&quot;&gt;&lt;td&gt;&lt;tt&gt;Qt::BackgroundColorRole&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;QColor.html&quot;&gt;&lt;tt&gt;QColor&lt;/tt&gt;&lt;/a&gt; (obsolete; use Qt::BackgroundRole instead)&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;&lt;tt&gt;Qt::CheckStateRole&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;Qt::CheckState&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;even&quot;&gt;&lt;td&gt;&lt;tt&gt;Qt::DecorationRole&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;QIcon.html&quot;&gt;&lt;tt&gt;QIcon&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QColor.html&quot;&gt;&lt;tt&gt;QColor&lt;/tt&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;&lt;tt&gt;Qt::DisplayRole&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;%2E%2E/porting4.html#qstring&quot;&gt;&lt;tt&gt;QString&lt;/tt&gt;&lt;/a&gt; and types with a string representation&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;even&quot;&gt;&lt;td&gt;&lt;tt&gt;Qt::EditRole&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;See &lt;a href=&quot;QItemEditorFactory.html&quot;&gt;&lt;tt&gt;QItemEditorFactory&lt;/tt&gt;&lt;/a&gt; for details&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;&lt;tt&gt;Qt::FontRole&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;QFont.html&quot;&gt;&lt;tt&gt;QFont&lt;/tt&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;even&quot;&gt;&lt;td&gt;&lt;tt&gt;Qt::SizeHintRole&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;%2E%2E/core/QSize.html&quot;&gt;&lt;tt&gt;QSize&lt;/tt&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;&lt;tt&gt;Qt::TextAlignmentRole&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;Qt::Alignment&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;even&quot;&gt;&lt;td&gt;&lt;tt&gt;Qt::ForegroundRole&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;QBrush.html&quot;&gt;&lt;tt&gt;QBrush&lt;/tt&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr valign=&quot;top&quot; class=&quot;odd&quot;&gt;&lt;td&gt;&lt;tt&gt;Qt::TextColorRole&lt;/tt&gt;&lt;/td&gt;&lt;td&gt;&lt;a href=&quot;QColor.html&quot;&gt;&lt;tt&gt;QColor&lt;/tt&gt;&lt;/a&gt; (obsolete; use Qt::ForegroundRole instead)&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;If the default delegate does not allow the level of customization that you need, either for display purposes or for editing data, it is possible to subclass &lt;a href=&quot;QItemDelegate.html#QItemDelegate(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QItemDelegate&lt;/tt&gt;&lt;/a&gt; to implement the desired behavior.&lt;/p&gt;
&lt;a name=&quot;subclassing&quot;&gt;&lt;/a&gt;
&lt;h3&gt;Subclassing&lt;/h3&gt;
&lt;p&gt;When subclassing &lt;a href=&quot;QItemDelegate.html#QItemDelegate(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QItemDelegate&lt;/tt&gt;&lt;/a&gt; to create a delegate that displays items using a custom renderer, it is important to ensure that the delegate can render items suitably for all the required states; e.g&amp;#x2e; selected, disabled, checked. The documentation for the &lt;a href=&quot;QItemDelegate.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; function contains some hints to show how this can be achieved.&lt;/p&gt;
&lt;p&gt;You can provide custom editors by using a &lt;a href=&quot;QItemEditorFactory.html&quot;&gt;&lt;tt&gt;QItemEditorFactory&lt;/tt&gt;&lt;/a&gt;. The Color Editor Factory Example&lt;/tt&gt; shows how a custom editor can be made available to delegates with the default item editor factory. This way, there is no need to subclass &lt;a href=&quot;QItemDelegate.html#QItemDelegate(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QItemDelegate&lt;/tt&gt;&lt;/a&gt;. An alternative is to reimplement &lt;a href=&quot;QItemDelegate.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;, &lt;a href=&quot;QItemDelegate.html#setEditorData(com.trolltech.qt.gui.QWidget, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;setEditorData&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QItemDelegate.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;, and &lt;a href=&quot;QItemDelegate.html#updateEditorGeometry(com.trolltech.qt.gui.QWidget, com.trolltech.qt.gui.QStyleOptionViewItem, com.trolltech.qt.core.QModelIndex)&quot;&gt;&lt;tt&gt;updateEditorGeometry&lt;/tt&gt;&lt;/a&gt;. This process is described in the Spin Box Delegate example&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;%2E%2E/model-view-delegate.html&quot;&gt;Delegate Classes&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QAbstractItemDelegate.html#QAbstractItemDelegate(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QAbstractItemDelegate&lt;/tt&gt;&lt;/a&gt;
@see Spin Box Delegate Example&lt;/tt&gt;
@see Settings Editor Example&lt;/tt&gt;
@see Icons 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 QItemDelegate(com.trolltech.qt.core.QObject parent)" doc="/**
&lt;p&gt;Constructs an item delegate with the given &lt;tt&gt;parent&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="public QItemDelegate()" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QItemDelegate.html#QItemDelegate(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QItemDelegate&lt;/tt&gt;&lt;/a&gt;(0). */"/>
    <method name="protected final com.trolltech.qt.core.QRect check(com.trolltech.qt.gui.QStyleOptionViewItem option, com.trolltech.qt.core.QRect bounding, java.lang.Object variant)" doc="/**
&lt;p&gt;&lt;/p&gt;
 */"/>
    <method name="protected final com.trolltech.qt.gui.QPixmap decoration(com.trolltech.qt.gui.QStyleOptionViewItem option, java.lang.Object variant)" doc="/**
&lt;p&gt;&lt;/p&gt;
 */"/>
    <method name="protected final void drawBackground(com.trolltech.qt.gui.QPainter painter, com.trolltech.qt.gui.QStyleOptionViewItem option, com.trolltech.qt.core.QModelIndex index)" doc="/**
&lt;p&gt;Renders the item background for the given &lt;tt&gt;index&lt;/tt&gt;, using the given &lt;tt&gt;painter&lt;/tt&gt; and style &lt;tt&gt;option&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="public final boolean hasClipping()" doc="/**
&lt;p&gt;Returns if the delegate should clip the paint events.&lt;/p&gt;
&lt;p&gt;This property will set the paint clip to the size of the item. The default value is on. It is useful for cases such as when images are larger then the size of the item.&lt;/p&gt;
 */"/>
    <method name="public final com.trolltech.qt.gui.QItemEditorFactory itemEditorFactory()" doc="/**
&lt;p&gt;Returns the editor factory used by the item delegate. If no editor factory is set, the function will return null.&lt;/p&gt;

@see &lt;a href=&quot;QItemDelegate.html#setItemEditorFactory(com.trolltech.qt.gui.QItemEditorFactory)&quot;&gt;&lt;tt&gt;setItemEditorFactory&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="protected final com.trolltech.qt.core.QRect rect(com.trolltech.qt.gui.QStyleOptionViewItem option, com.trolltech.qt.core.QModelIndex index, int role)" doc="/**
&lt;p&gt;&lt;/p&gt;
 */"/>
    <method name="public final void setClipping(boolean clip)" doc="/**
&lt;p&gt;Sets if the delegate should clip the paint events to &lt;tt&gt;clip&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;This property will set the paint clip to the size of the item. The default value is on. It is useful for cases such as when images are larger then the size of the item.&lt;/p&gt;

@see &lt;a href=&quot;QItemDelegate.html#hasClipping()&quot;&gt;&lt;tt&gt;hasClipping&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setItemEditorFactory(com.trolltech.qt.gui.QItemEditorFactory factory)" doc="/**
&lt;p&gt;Sets the editor factory to be used by the item delegate to be the &lt;tt&gt;factory&lt;/tt&gt; specified. If no editor factory is set, the item delegate will use the default editor factory.&lt;/p&gt;

@see &lt;a href=&quot;QItemDelegate.html#itemEditorFactory()&quot;&gt;&lt;tt&gt;itemEditorFactory&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="protected final com.trolltech.qt.gui.QStyleOptionViewItem setOptions(com.trolltech.qt.core.QModelIndex index, com.trolltech.qt.gui.QStyleOptionViewItem option)" doc="/**
&lt;p&gt;&lt;/p&gt;
 */"/>
    <method name="protected final com.trolltech.qt.core.QRect textRectangle(com.trolltech.qt.gui.QPainter painter, com.trolltech.qt.core.QRect rect, com.trolltech.qt.gui.QFont font, java.lang.String text)" doc="/**
&lt;p&gt;&lt;/p&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 widget used to edit the item specified by &lt;tt&gt;index&lt;/tt&gt; for editing. The &lt;tt&gt;parent&lt;/tt&gt; widget and style &lt;tt&gt;option&lt;/tt&gt; are used to control how the editor widget appears.&lt;/p&gt;

@see &lt;tt&gt;QAbstractItemDelegate::createEditor&lt;/tt&gt; */"/>
    <method name="protected void drawCheck(com.trolltech.qt.gui.QPainter painter, com.trolltech.qt.gui.QStyleOptionViewItem option, com.trolltech.qt.core.QRect rect, com.trolltech.qt.core.Qt.CheckState state)" doc="/**
&lt;p&gt;Renders a check indicator within the rectangle specified by &lt;tt&gt;rect&lt;/tt&gt;, using the given &lt;tt&gt;painter&lt;/tt&gt; and style &lt;tt&gt;option&lt;/tt&gt;, using the given &lt;tt&gt;state&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="protected void drawDecoration(com.trolltech.qt.gui.QPainter painter, com.trolltech.qt.gui.QStyleOptionViewItem option, com.trolltech.qt.core.QRect rect, com.trolltech.qt.gui.QPixmap pixmap)" doc="/**
&lt;p&gt;Renders the decoration &lt;tt&gt;pixmap&lt;/tt&gt; within the rectangle specified by &lt;tt&gt;rect&lt;/tt&gt; using the given &lt;tt&gt;painter&lt;/tt&gt; and style &lt;tt&gt;option&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="protected void drawDisplay(com.trolltech.qt.gui.QPainter painter, com.trolltech.qt.gui.QStyleOptionViewItem option, com.trolltech.qt.core.QRect rect, java.lang.String text)" doc="/**
&lt;p&gt;Renders the item view &lt;tt&gt;text&lt;/tt&gt; within the rectangle specified by &lt;tt&gt;rect&lt;/tt&gt; using the given &lt;tt&gt;painter&lt;/tt&gt; and style &lt;tt&gt;option&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="protected void drawFocus(com.trolltech.qt.gui.QPainter painter, com.trolltech.qt.gui.QStyleOptionViewItem option, com.trolltech.qt.core.QRect rect)" doc="/**
&lt;p&gt;Renders the region within the rectangle specified by &lt;tt&gt;rect&lt;/tt&gt;, indicating that it has the focus, using the given &lt;tt&gt;painter&lt;/tt&gt; and style &lt;tt&gt;option&lt;/tt&gt;.&lt;/p&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;This function is reimplemented for internal reasons.&lt;/p&gt;
 */"/>
    <method name="public boolean eventFilter(com.trolltech.qt.core.QObject object, com.trolltech.qt.core.QEvent event)" doc="/**
&lt;p&gt;Returns true if the given &lt;tt&gt;object&lt;/tt&gt; is a valid &lt;a href=&quot;QWidget.html&quot;&gt;&lt;tt&gt;QWidget&lt;/tt&gt;&lt;/a&gt; and the given &lt;tt&gt;event&lt;/tt&gt; is handled; otherwise returns false. The following key press events are handled by default:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Tab&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Backtab&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Enter&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Return&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Esc&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the case of &lt;b&gt;Tab&lt;/b&gt;, &lt;b&gt;Backtab&lt;/b&gt;, &lt;b&gt;Enter&lt;/b&gt; and &lt;b&gt;Return&lt;/b&gt; key press events, the &lt;tt&gt;object&lt;/tt&gt;'s data is comitted to the model and the editor is closed. If the &lt;tt&gt;event&lt;/tt&gt; is a &lt;b&gt;Tab&lt;/b&gt; key press the view will open an editor on the next item in the view. Likewise, if the &lt;tt&gt;event&lt;/tt&gt; is a &lt;b&gt;Backtab&lt;/b&gt; key press the view will open an editor on the &lt;i&gt;previous&lt;/i&gt; item in the view.&lt;/p&gt;
&lt;p&gt;If the event is a &lt;b&gt;Esc&lt;/b&gt; key press event, the &lt;tt&gt;object&lt;/tt&gt; is closed &lt;i&gt;without&lt;/i&gt; committing its data.&lt;/p&gt;

@see &lt;a href=&quot;QItemDelegate.html#commitData(com.trolltech.qt.gui.QWidget)&quot;&gt;&lt;tt&gt;commitData&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QItemDelegate.html#closeEditor(com.trolltech.qt.gui.QWidget, com.trolltech.qt.gui.QAbstractItemDelegate.EndEditHint)&quot;&gt;&lt;tt&gt;closeEditor&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public void paint(com.trolltech.qt.gui.QPainter painter, com.trolltech.qt.gui.QStyleOptionViewItem option, com.trolltech.qt.core.QModelIndex index)" doc="/**
&lt;p&gt;Renders the delegate using the given &lt;tt&gt;painter&lt;/tt&gt; and style &lt;tt&gt;option&lt;/tt&gt; for the item specified by &lt;tt&gt;index&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;When reimplementing this function in a subclass, you should update the area held by the option's rect&lt;/tt&gt; variable, using the option's state&lt;/tt&gt; variable to determine the state of the item to be displayed, and adjust the way it is painted accordingly.&lt;/p&gt;
&lt;p&gt;For example, a selected item may need to be displayed differently to unselected items, as shown in the following code:&lt;/p&gt;
&lt;pre&gt;        if (option.state &amp;amp; QStyle::State_Selected)
            painter-&amp;gt;fillRect(option.rect, option.palette.highlight());

        int size = qMin(option.rect.width(), option.rect.height());
        int brightness = index.model()-&amp;gt;data(index, Qt::DisplayRole).toInt();
        double radius = (size/2.0) - (brightness/255.0 * size/2.0);
        if (radius == 0.0)
            return;

        painter-&amp;gt;save();
        painter-&amp;gt;setRenderHint(QPainter::Antialiasing, true);
        painter-&amp;gt;setPen(Qt::NoPen);
        if (option.state &amp;amp; QStyle::State_Selected)
            painter-&amp;gt;setBrush(option.palette.highlightedText());
        else
        ...&lt;/pre&gt;
&lt;p&gt;After painting, you should ensure that the painter is returned to its the state it was supplied in when this function was called. For example, it may be useful to call QPainter::save() before painting and QPainter::restore() afterwards.&lt;/p&gt;

@see &lt;tt&gt;QStyle::State&lt;/tt&gt; */"/>
    <method name="public void setEditorData(com.trolltech.qt.gui.QWidget editor, com.trolltech.qt.core.QModelIndex index)" doc="/**
&lt;p&gt;Sets the data to be displayed and edited by the &lt;tt&gt;editor&lt;/tt&gt; for the item specified by &lt;tt&gt;index&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;The default implementation uses the editor's user property to set values.&lt;/p&gt;

@see &lt;tt&gt;QMetaProperty::isUser&lt;/tt&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 specified &lt;tt&gt;model&lt;/tt&gt; and item &lt;tt&gt;index&lt;/tt&gt; from that supplied by the &lt;tt&gt;editor&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;The default implementation uses the editor's user property to get values.&lt;/p&gt;

@see &lt;tt&gt;QMetaProperty::isUser&lt;/tt&gt; */"/>
    <method name="public com.trolltech.qt.core.QSize sizeHint(com.trolltech.qt.gui.QStyleOptionViewItem option, com.trolltech.qt.core.QModelIndex index)" doc="/**
&lt;p&gt;Returns the size needed by the delegate to display the item specified by &lt;tt&gt;index&lt;/tt&gt;, taking into account the style information provided by &lt;tt&gt;option&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;When reimplementing this function, note that in case of text items, &lt;a href=&quot;QItemDelegate.html#QItemDelegate(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QItemDelegate&lt;/tt&gt;&lt;/a&gt; adds a margin (i.e&amp;#x2e; 2 * QStyle::PM_FocusFrameHMargin) to the length of the text.&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 &lt;tt&gt;editor&lt;/tt&gt; for the item specified by &lt;tt&gt;index&lt;/tt&gt; according to the style &lt;tt&gt;option&lt;/tt&gt; given.&lt;/p&gt;
 */"/>
</class>
