<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html><head><title>QListWidgetItem Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } td.postheader { font-family: sans-serif } tr.address { font-family: sans-serif } body { background: #ffffff; color: black; } </style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QListWidgetItem Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QListWidgetItem class provides an item for use with the <a href="qlistwidget.html">QListWidget</a> item view class. <a href="#details">More...</a></p> <h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qlistwidgetitem.html#ItemType-enum">ItemType</a></b> { Type, UserType }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qlistwidgetitem.html#QListWidgetItem">__init__</a></b> (<i>self</i>, QListWidget <i>parent</i> = None, int <i>type</i> = QListWidgetItem.Type)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#QListWidgetItem-2">__init__</a></b> (<i>self</i>, QString <i>text</i>, QListWidget <i>parent</i> = None, int <i>type</i> = QListWidgetItem.Type)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#QListWidgetItem-3">__init__</a></b> (<i>self</i>, QIcon <i>icon</i>, QString <i>text</i>, QListWidget <i>parent</i> = None, int <i>type</i> = QListWidgetItem.Type)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#QListWidgetItem-4">__init__</a></b> (<i>self</i>, QListWidgetItem <i>other</i>)</li><li><div class="fn" />QBrush <b><a href="qlistwidgetitem.html#background">background</a></b> (<i>self</i>)</li><li><div class="fn" />QColor <b><a href="qlistwidgetitem.html#backgroundColor">backgroundColor</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.CheckState <b><a href="qlistwidgetitem.html#checkState">checkState</a></b> (<i>self</i>)</li><li><div class="fn" />QListWidgetItem <b><a href="qlistwidgetitem.html#clone">clone</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qlistwidgetitem.html#data">data</a></b> (<i>self</i>, int <i>role</i>)</li><li><div class="fn" />Qt.ItemFlags <b><a href="qlistwidgetitem.html#flags">flags</a></b> (<i>self</i>)</li><li><div class="fn" />QFont <b><a href="qlistwidgetitem.html#font">font</a></b> (<i>self</i>)</li><li><div class="fn" />QBrush <b><a href="qlistwidgetitem.html#foreground">foreground</a></b> (<i>self</i>)</li><li><div class="fn" />QIcon <b><a href="qlistwidgetitem.html#icon">icon</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qlistwidgetitem.html#isHidden">isHidden</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qlistwidgetitem.html#isSelected">isSelected</a></b> (<i>self</i>)</li><li><div class="fn" />QListWidget <b><a href="qlistwidgetitem.html#listWidget">listWidget</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#read">read</a></b> (<i>self</i>, QDataStream <i>in</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#setBackground">setBackground</a></b> (<i>self</i>, QBrush <i>brush</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#setBackgroundColor">setBackgroundColor</a></b> (<i>self</i>, QColor <i>color</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#setCheckState">setCheckState</a></b> (<i>self</i>, Qt.CheckState <i>state</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#setData">setData</a></b> (<i>self</i>, int <i>role</i>, QVariant <i>value</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#setFlags">setFlags</a></b> (<i>self</i>, Qt.ItemFlags <i>aflags</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#setFont">setFont</a></b> (<i>self</i>, QFont <i>afont</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#setForeground">setForeground</a></b> (<i>self</i>, QBrush <i>brush</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#setHidden">setHidden</a></b> (<i>self</i>, bool <i>ahide</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#setIcon">setIcon</a></b> (<i>self</i>, QIcon <i>aicon</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#setSelected">setSelected</a></b> (<i>self</i>, bool <i>aselect</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#setSizeHint">setSizeHint</a></b> (<i>self</i>, QSize <i>size</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#setStatusTip">setStatusTip</a></b> (<i>self</i>, QString <i>astatusTip</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#setText">setText</a></b> (<i>self</i>, QString <i>atext</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#setTextAlignment">setTextAlignment</a></b> (<i>self</i>, int <i>alignment</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#setTextColor">setTextColor</a></b> (<i>self</i>, QColor <i>color</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#setToolTip">setToolTip</a></b> (<i>self</i>, QString <i>atoolTip</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#setWhatsThis">setWhatsThis</a></b> (<i>self</i>, QString <i>awhatsThis</i>)</li><li><div class="fn" />QSize <b><a href="qlistwidgetitem.html#sizeHint">sizeHint</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qlistwidgetitem.html#statusTip">statusTip</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qlistwidgetitem.html#text">text</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qlistwidgetitem.html#textAlignment">textAlignment</a></b> (<i>self</i>)</li><li><div class="fn" />QColor <b><a href="qlistwidgetitem.html#textColor">textColor</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qlistwidgetitem.html#toolTip">toolTip</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qlistwidgetitem.html#type">type</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qlistwidgetitem.html#whatsThis">whatsThis</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qlistwidgetitem.html#write">write</a></b> (<i>self</i>, QDataStream <i>out</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />bool <b><a href="qlistwidgetitem.html#__ge__">__ge__</a></b> (<i>self</i>, QListWidgetItem <i>other</i>)</li><li><div class="fn" />bool <b><a href="qlistwidgetitem.html#__lt__">__lt__</a></b> (<i>self</i>, QListWidgetItem <i>other</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QListWidgetItem class provides an item for use with the <a href="qlistwidget.html">QListWidget</a> item view class.</p> <p>A QListWidgetItem represents a single item in a <a href="qlistwidget.html">QListWidget</a>. Each item can hold several pieces of information, and will display them appropriately.</p> <p>The item view convenience classes use a classic item-based interface rather than a pure model/view approach. For a more flexible list view widget, consider using the <a href="qlistview.html">QListView</a> class with a standard model.</p> <p>List items can be inserted automatically into a list, when they are constructed, by specifying the list widget:</p> <pre class="cpp"> <span class="keyword">new</span> <span class="type">QListWidgetItem</span>(tr(<span class="string">"Hazel"</span>)<span class="operator">,</span> listWidget); </pre> <p>Alternatively, list items can also be created without a parent widget, and later inserted into a list using <a href="qlistwidget.html#insertItem">QListWidget.insertItem</a>().</p> <p>List items are typically used to display <a href="qlistwidgetitem.html#text">text</a>() and an <a href="qlistwidgetitem.html#icon">icon</a>(). These are set with the <a href="qlistwidgetitem.html#setText">setText</a>() and <a href="qlistwidgetitem.html#setIcon">setIcon</a>() functions. The appearance of the text can be customized with <a href="qlistwidgetitem.html#setFont">setFont</a>(), <a href="qlistwidgetitem.html#setForeground">setForeground</a>(), and <a href="qlistwidgetitem.html#setBackground">setBackground</a>(). Text in list items can be aligned using the <a href="qlistwidgetitem.html#setTextAlignment">setTextAlignment</a>() function. Tooltips, status tips and "What's This?" help can be added to list items with <a href="qlistwidgetitem.html#setToolTip">setToolTip</a>(), <a href="qlistwidgetitem.html#setStatusTip">setStatusTip</a>(), and <a href="qlistwidgetitem.html#setWhatsThis">setWhatsThis</a>().</p> <p>By default, items are enabled, selectable, checkable, and can be the source of drag and drop operations.</p> <p>Each item's flags can be changed by calling <a href="qlistwidgetitem.html#setFlags">setFlags</a>() with the appropriate value (see <a href="qt.html#ItemFlag-enum">Qt.ItemFlags</a>). Checkable items can be checked, unchecked and partially checked with the <a href="qlistwidgetitem.html#setCheckState">setCheckState</a>() function. The corresponding <a href="qlistwidgetitem.html#checkState">checkState</a>() function indicates the item's current check state.</p> <p>The <a href="qlistwidgetitem.html#isHidden">isHidden</a>() function can be used to determine whether the item is hidden. To hide an item, use <a href="qlistwidgetitem.html#setHidden">setHidden</a>().</p> <a id="subclassing" name="subclassing" /> <h3>Subclassing</h3> <p>When subclassing QListWidgetItem to provide custom items, it is possible to define new types for them enabling them to be distinguished from standard items. For subclasses that require this feature, ensure that you call the base class constructor with a new type value equal to or greater than <a href="qlistwidgetitem.html#ItemType-enum">UserType</a>, within <i>your</i> constructor.</p> <hr /><h2>Type Documentation</h2><h3 class="fn"><a name="ItemType-enum" />QListWidgetItem.ItemType</h3><p>This enum describes the types that are used to describe list widget items.</p> <table class="valuelist"> <tr class="odd" valign="top"> <th class="tblConst">Constant</th> <th class="tblval">Value</th> <th class="tbldscr">Description</th> </tr> <tr> <td class="topAlign"><tt>QListWidgetItem.Type</tt></td> <td class="topAlign"><tt>0</tt></td> <td class="topAlign">The default type for list widget items.</td> </tr> <tr> <td class="topAlign"><tt>QListWidgetItem.UserType</tt></td> <td class="topAlign"><tt>1000</tt></td> <td class="topAlign">The minimum value for custom types. Values below UserType are reserved by Qt.</td> </tr> </table> <p>You can define new user types in <a href="qlistwidgetitem.html">QListWidgetItem</a> subclasses to ensure that custom items are treated specially.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#type">type</a>().</p> <hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QListWidgetItem" />QListWidgetItem.__init__ (<i>self</i>, <a href="qlistwidget.html">QListWidget</a> <i>parent</i> = None, int <i>type</i> = QListWidgetItem.Type)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs an empty list widget item of the specified <i>type</i> with the given <i>parent</i>. If <i>parent</i> is not specified, the item will need to be inserted into a list widget with <a href="qlistwidget.html#insertItem">QListWidget.insertItem</a>().</p> <p>This constructor inserts the item into the model of the parent that is passed to the constructor. If the model is sorted then the behavior of the insert is undetermined since the model will call the <tt>'<'</tt> operator method on the item which, at this point, is not yet constructed. To avoid the undetermined behavior, we recommend not to specify the parent and use <a href="qlistwidget.html#insertItem">QListWidget.insertItem</a>() instead.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#type">type</a>().</p> <h3 class="fn"><a name="QListWidgetItem-2" />QListWidgetItem.__init__ (<i>self</i>, QString <i>text</i>, <a href="qlistwidget.html">QListWidget</a> <i>parent</i> = None, int <i>type</i> = QListWidgetItem.Type)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs an empty list widget item of the specified <i>type</i> with the given <i>text</i> and <i>parent</i>. If the parent is not specified, the item will need to be inserted into a list widget with <a href="qlistwidget.html#insertItem">QListWidget.insertItem</a>().</p> <p>This constructor inserts the item into the model of the parent that is passed to the constructor. If the model is sorted then the behavior of the insert is undetermined since the model will call the <tt>'<'</tt> operator method on the item which, at this point, is not yet constructed. To avoid the undetermined behavior, we recommend not to specify the parent and use <a href="qlistwidget.html#insertItem">QListWidget.insertItem</a>() instead.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#type">type</a>().</p> <h3 class="fn"><a name="QListWidgetItem-3" />QListWidgetItem.__init__ (<i>self</i>, <a href="qicon.html">QIcon</a> <i>icon</i>, QString <i>text</i>, <a href="qlistwidget.html">QListWidget</a> <i>parent</i> = None, int <i>type</i> = QListWidgetItem.Type)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs an empty list widget item of the specified <i>type</i> with the given <i>icon</i>, <i>text</i> and <i>parent</i>. If the parent is not specified, the item will need to be inserted into a list widget with <a href="qlistwidget.html#insertItem">QListWidget.insertItem</a>().</p> <p>This constructor inserts the item into the model of the parent that is passed to the constructor. If the model is sorted then the behavior of the insert is undetermined since the model will call the <tt>'<'</tt> operator method on the item which, at this point, is not yet constructed. To avoid the undetermined behavior, we recommend not to specify the parent and use <a href="qlistwidget.html#insertItem">QListWidget.insertItem</a>() instead.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#type">type</a>().</p> <h3 class="fn"><a name="QListWidgetItem-4" />QListWidgetItem.__init__ (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>other</i>)</h3><p>Constructs a copy of <i>other</i>. Note that <a href="qlistwidgetitem.html#type">type</a>() and <a href="qlistwidgetitem.html#listWidget">listWidget</a>() are not copied.</p> <p>This function is useful when reimplementing <a href="qlistwidgetitem.html#clone">clone</a>().</p> <p>This function was introduced in Qt 4.1.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#data">data</a>() and <a href="qlistwidgetitem.html#flags">flags</a>().</p> <h3 class="fn"><a name="background" /><a href="qbrush.html">QBrush</a> QListWidgetItem.background (<i>self</i>)</h3><p>Returns the brush used to display the list item's background.</p> <p>This function was introduced in Qt 4.2.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#setBackground">setBackground</a>() and <a href="qlistwidgetitem.html#foreground">foreground</a>().</p> <h3 class="fn"><a name="backgroundColor" /><a href="qcolor.html">QColor</a> QListWidgetItem.backgroundColor (<i>self</i>)</h3><h3 class="fn"><a name="checkState" /><a href="qt.html#CheckState-enum">Qt.CheckState</a> QListWidgetItem.checkState (<i>self</i>)</h3><p>Returns the checked state of the list item (see <a href="qt.html#CheckState-enum">Qt.CheckState</a>).</p> <p><b>See also</b> <a href="qlistwidgetitem.html#setCheckState">setCheckState</a>() and <a href="qlistwidgetitem.html#flags">flags</a>().</p> <h3 class="fn"><a name="clone" /><a href="qlistwidgetitem.html">QListWidgetItem</a> QListWidgetItem.clone (<i>self</i>)</h3><p>Creates an exact copy of the item.</p> <h3 class="fn"><a name="data" />QVariant QListWidgetItem.data (<i>self</i>, int <i>role</i>)</h3><p>Returns the item's data for a given <i>role</i>. Reimplement this function if you need extra roles or special behavior for certain roles.</p> <p><b>See also</b> <a href="qt.html#ItemDataRole-enum">Qt.ItemDataRole</a> and <a href="qlistwidgetitem.html#setData">setData</a>().</p> <h3 class="fn"><a name="flags" /><a href="qt-itemflags.html">Qt.ItemFlags</a> QListWidgetItem.flags (<i>self</i>)</h3><p>Returns the item flags for this item (see <a href="qt.html#ItemFlag-enum">Qt.ItemFlags</a>).</p> <p><b>See also</b> <a href="qlistwidgetitem.html#setFlags">setFlags</a>().</p> <h3 class="fn"><a name="font" /><a href="qfont.html">QFont</a> QListWidgetItem.font (<i>self</i>)</h3><p>Returns the font used to display this list item's text.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#setFont">setFont</a>().</p> <h3 class="fn"><a name="foreground" /><a href="qbrush.html">QBrush</a> QListWidgetItem.foreground (<i>self</i>)</h3><p>Returns the brush used to display the list item's foreground (e.g. text).</p> <p>This function was introduced in Qt 4.2.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#setForeground">setForeground</a>() and <a href="qlistwidgetitem.html#background">background</a>().</p> <h3 class="fn"><a name="icon" /><a href="qicon.html">QIcon</a> QListWidgetItem.icon (<i>self</i>)</h3><p>Returns the list item's icon.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#setIcon">setIcon</a>() and <a href="qabstractitemview.html#iconSize-prop">iconSize</a>.</p> <h3 class="fn"><a name="isHidden" />bool QListWidgetItem.isHidden (<i>self</i>)</h3><p>Returns true if the item is hidden; otherwise returns false.</p> <p>This function was introduced in Qt 4.2.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#setHidden">setHidden</a>().</p> <h3 class="fn"><a name="isSelected" />bool QListWidgetItem.isSelected (<i>self</i>)</h3><p>Returns true if the item is selected; otherwise returns false.</p> <p>This function was introduced in Qt 4.2.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#setSelected">setSelected</a>().</p> <h3 class="fn"><a name="listWidget" /><a href="qlistwidget.html">QListWidget</a> QListWidgetItem.listWidget (<i>self</i>)</h3><p>Returns the list widget containing the item.</p> <h3 class="fn"><a name="read" />QListWidgetItem.read (<i>self</i>, <a href="qdatastream.html">QDataStream</a> <i>in</i>)</h3><p>Reads the item from stream <i>in</i>.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#write">write</a>().</p> <h3 class="fn"><a name="setBackground" />QListWidgetItem.setBackground (<i>self</i>, <a href="qbrush.html">QBrush</a> <i>brush</i>)</h3><p>Sets the background brush of the list item to the given <i>brush</i>.</p> <p>This function was introduced in Qt 4.2.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#background">background</a>() and <a href="qlistwidgetitem.html#setForeground">setForeground</a>().</p> <h3 class="fn"><a name="setBackgroundColor" />QListWidgetItem.setBackgroundColor (<i>self</i>, <a href="qcolor.html">QColor</a> <i>color</i>)</h3><h3 class="fn"><a name="setCheckState" />QListWidgetItem.setCheckState (<i>self</i>, <a href="qt.html#CheckState-enum">Qt.CheckState</a> <i>state</i>)</h3><p>Sets the check state of the list item to <i>state</i>.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#checkState">checkState</a>().</p> <h3 class="fn"><a name="setData" />QListWidgetItem.setData (<i>self</i>, int <i>role</i>, QVariant <i>value</i>)</h3><p>Sets the data for a given <i>role</i> to the given <i>value</i>. Reimplement this function if you need extra roles or special behavior for certain roles.</p> <p><b>See also</b> <a href="qt.html#ItemDataRole-enum">Qt.ItemDataRole</a> and <a href="qlistwidgetitem.html#data">data</a>().</p> <h3 class="fn"><a name="setFlags" />QListWidgetItem.setFlags (<i>self</i>, <a href="qt-itemflags.html">Qt.ItemFlags</a> <i>aflags</i>)</h3><p>Sets the item flags for the list item to <i>flags</i>.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#flags">flags</a>() and <a href="qt.html#ItemFlag-enum">Qt.ItemFlags</a>.</p> <h3 class="fn"><a name="setFont" />QListWidgetItem.setFont (<i>self</i>, <a href="qfont.html">QFont</a> <i>afont</i>)</h3><p>Sets the font used when painting the item to the given <i>font</i>.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#font">font</a>().</p> <h3 class="fn"><a name="setForeground" />QListWidgetItem.setForeground (<i>self</i>, <a href="qbrush.html">QBrush</a> <i>brush</i>)</h3><p>Sets the foreground brush of the list item to the given <i>brush</i>.</p> <p>This function was introduced in Qt 4.2.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#foreground">foreground</a>() and <a href="qlistwidgetitem.html#setBackground">setBackground</a>().</p> <h3 class="fn"><a name="setHidden" />QListWidgetItem.setHidden (<i>self</i>, bool <i>ahide</i>)</h3><p>Hides the item if <i>hide</i> is true; otherwise shows the item.</p> <p>This function was introduced in Qt 4.2.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#isHidden">isHidden</a>().</p> <h3 class="fn"><a name="setIcon" />QListWidgetItem.setIcon (<i>self</i>, <a href="qicon.html">QIcon</a> <i>aicon</i>)</h3><p>Sets the icon for the list item to the given <i>icon</i>.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#icon">icon</a>(), <a href="qlistwidgetitem.html#text">text</a>(), and <a href="qabstractitemview.html#iconSize-prop">iconSize</a>.</p> <h3 class="fn"><a name="setSelected" />QListWidgetItem.setSelected (<i>self</i>, bool <i>aselect</i>)</h3><p>Sets the selected state of the item to <i>select</i>.</p> <p>This function was introduced in Qt 4.2.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#isSelected">isSelected</a>().</p> <h3 class="fn"><a name="setSizeHint" />QListWidgetItem.setSizeHint (<i>self</i>, <a href="qsize.html">QSize</a> <i>size</i>)</h3><p>Sets the size hint for the list item to be <i>size</i>. If no size hint is set, the item delegate will compute the size hint based on the item data.</p> <p>This function was introduced in Qt 4.1.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#sizeHint">sizeHint</a>().</p> <h3 class="fn"><a name="setStatusTip" />QListWidgetItem.setStatusTip (<i>self</i>, QString <i>astatusTip</i>)</h3><p>Sets the status tip for the list item to the text specified by <i>statusTip</i>. <a href="qlistwidget.html">QListWidget</a> mouseTracking needs to be enabled for this feature to work.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#statusTip">statusTip</a>(), <a href="qlistwidgetitem.html#setToolTip">setToolTip</a>(), <a href="qlistwidgetitem.html#setWhatsThis">setWhatsThis</a>(), and <a href="qwidget.html#mouseTracking-prop">QWidget.setMouseTracking</a>().</p> <h3 class="fn"><a name="setText" />QListWidgetItem.setText (<i>self</i>, QString <i>atext</i>)</h3><p>Sets the text for the list widget item's to the given <i>text</i>.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#text">text</a>().</p> <h3 class="fn"><a name="setTextAlignment" />QListWidgetItem.setTextAlignment (<i>self</i>, int <i>alignment</i>)</h3><p>Sets the list item's text alignment to <i>alignment</i>.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#textAlignment">textAlignment</a>() and <a href="qt.html#AlignmentFlag-enum">Qt.AlignmentFlag</a>.</p> <h3 class="fn"><a name="setTextColor" />QListWidgetItem.setTextColor (<i>self</i>, <a href="qcolor.html">QColor</a> <i>color</i>)</h3><h3 class="fn"><a name="setToolTip" />QListWidgetItem.setToolTip (<i>self</i>, QString <i>atoolTip</i>)</h3><p>Sets the tooltip for the list item to the text specified by <i>toolTip</i>.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#toolTip">toolTip</a>(), <a href="qlistwidgetitem.html#setStatusTip">setStatusTip</a>(), and <a href="qlistwidgetitem.html#setWhatsThis">setWhatsThis</a>().</p> <h3 class="fn"><a name="setWhatsThis" />QListWidgetItem.setWhatsThis (<i>self</i>, QString <i>awhatsThis</i>)</h3><p>Sets the "What's This?" help for the list item to the text specified by <i>whatsThis</i>.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#whatsThis">whatsThis</a>(), <a href="qlistwidgetitem.html#setStatusTip">setStatusTip</a>(), and <a href="qlistwidgetitem.html#setToolTip">setToolTip</a>().</p> <h3 class="fn"><a name="sizeHint" /><a href="qsize.html">QSize</a> QListWidgetItem.sizeHint (<i>self</i>)</h3><p>Returns the size hint set for the list item.</p> <p>This function was introduced in Qt 4.1.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#setSizeHint">setSizeHint</a>().</p> <h3 class="fn"><a name="statusTip" />QString QListWidgetItem.statusTip (<i>self</i>)</h3><p>Returns the list item's status tip.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#setStatusTip">setStatusTip</a>().</p> <h3 class="fn"><a name="text" />QString QListWidgetItem.text (<i>self</i>)</h3><p>Returns the list item's text.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#setText">setText</a>().</p> <h3 class="fn"><a name="textAlignment" />int QListWidgetItem.textAlignment (<i>self</i>)</h3><p>Returns the text alignment for the list item.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#setTextAlignment">setTextAlignment</a>() and <a href="qt.html#AlignmentFlag-enum">Qt.AlignmentFlag</a>.</p> <h3 class="fn"><a name="textColor" /><a href="qcolor.html">QColor</a> QListWidgetItem.textColor (<i>self</i>)</h3><h3 class="fn"><a name="toolTip" />QString QListWidgetItem.toolTip (<i>self</i>)</h3><p>Returns the list item's tooltip.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#setToolTip">setToolTip</a>(), <a href="qlistwidgetitem.html#statusTip">statusTip</a>(), and <a href="qlistwidgetitem.html#whatsThis">whatsThis</a>().</p> <h3 class="fn"><a name="type" />int QListWidgetItem.type (<i>self</i>)</h3><p>Returns the type passed to the <a href="qlistwidgetitem.html">QListWidgetItem</a> constructor.</p> <h3 class="fn"><a name="whatsThis" />QString QListWidgetItem.whatsThis (<i>self</i>)</h3><p>Returns the list item's "What's This?" help text.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#setWhatsThis">setWhatsThis</a>(), <a href="qlistwidgetitem.html#statusTip">statusTip</a>(), and <a href="qlistwidgetitem.html#toolTip">toolTip</a>().</p> <h3 class="fn"><a name="write" />QListWidgetItem.write (<i>self</i>, <a href="qdatastream.html">QDataStream</a> <i>out</i>)</h3><p>Writes the item to stream <i>out</i>.</p> <p><b>See also</b> <a href="qlistwidgetitem.html#read">read</a>().</p> <h3 class="fn"><a name="__ge__" />bool QListWidgetItem.__ge__ (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>other</i>)</h3><h3 class="fn"><a name="__lt__" />bool QListWidgetItem.__lt__ (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>other</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.10.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt 4.8.5</td></tr></table></div></address></body></html>