1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
<?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>QListWidget 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="../pyqt4ref.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">QListWidget Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QListWidget class provides an item-based list widget. <a href="#details">More...</a></p>
<p>Inherits <a href="qlistview.html">QListView</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qlistwidget.html#QListWidget">__init__</a></b> (<i>self</i>, QWidget <i>parent</i> = None)</li><li><div class="fn" /><b><a href="qlistwidget.html#addItem">addItem</a></b> (<i>self</i>, QListWidgetItem <i>aitem</i>)</li><li><div class="fn" /><b><a href="qlistwidget.html#addItem-2">addItem</a></b> (<i>self</i>, QString <i>label</i>)</li><li><div class="fn" /><b><a href="qlistwidget.html#addItems">addItems</a></b> (<i>self</i>, QStringList <i>labels</i>)</li><li><div class="fn" /><b><a href="qlistwidget.html#clear">clear</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qlistwidget.html#closePersistentEditor">closePersistentEditor</a></b> (<i>self</i>, QListWidgetItem <i>item</i>)</li><li><div class="fn" />int <b><a href="qlistwidget.html#count">count</a></b> (<i>self</i>)</li><li><div class="fn" />QListWidgetItem <b><a href="qlistwidget.html#currentItem">currentItem</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qlistwidget.html#currentRow">currentRow</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qlistwidget.html#dropMimeData">dropMimeData</a></b> (<i>self</i>, int <i>index</i>, QMimeData <i>data</i>, Qt.DropAction <i>action</i>)</li><li><div class="fn" /><b><a href="qlistwidget.html#editItem">editItem</a></b> (<i>self</i>, QListWidgetItem <i>item</i>)</li><li><div class="fn" />bool <b><a href="qlistwidget.html#event">event</a></b> (<i>self</i>, QEvent <i>e</i>)</li><li><div class="fn" />QListWidgetItem-list <b><a href="qlistwidget.html#findItems">findItems</a></b> (<i>self</i>, QString <i>text</i>, Qt.MatchFlags <i>flags</i>)</li><li><div class="fn" />QModelIndex <b><a href="qlistwidget.html#indexFromItem">indexFromItem</a></b> (<i>self</i>, QListWidgetItem <i>item</i>)</li><li><div class="fn" /><b><a href="qlistwidget.html#insertItem">insertItem</a></b> (<i>self</i>, int <i>row</i>, QListWidgetItem <i>item</i>)</li><li><div class="fn" /><b><a href="qlistwidget.html#insertItem-2">insertItem</a></b> (<i>self</i>, int <i>row</i>, QString <i>label</i>)</li><li><div class="fn" /><b><a href="qlistwidget.html#insertItems">insertItems</a></b> (<i>self</i>, int <i>row</i>, QStringList <i>labels</i>)</li><li><div class="fn" />bool <b><a href="qlistwidget.html#isItemHidden">isItemHidden</a></b> (<i>self</i>, QListWidgetItem <i>item</i>)</li><li><div class="fn" />bool <b><a href="qlistwidget.html#isItemSelected">isItemSelected</a></b> (<i>self</i>, QListWidgetItem <i>item</i>)</li><li><div class="fn" />QListWidgetItem <b><a href="qlistwidget.html#item">item</a></b> (<i>self</i>, int <i>row</i>)</li><li><div class="fn" />QListWidgetItem <b><a href="qlistwidget.html#itemAt">itemAt</a></b> (<i>self</i>, QPoint <i>p</i>)</li><li><div class="fn" />QListWidgetItem <b><a href="qlistwidget.html#itemAt-2">itemAt</a></b> (<i>self</i>, int <i>ax</i>, int <i>ay</i>)</li><li><div class="fn" />QListWidgetItem <b><a href="qlistwidget.html#itemFromIndex">itemFromIndex</a></b> (<i>self</i>, QModelIndex <i>index</i>)</li><li><div class="fn" />QListWidgetItem-list <b><a href="qlistwidget.html#items">items</a></b> (<i>self</i>, QMimeData <i>data</i>)</li><li><div class="fn" />QWidget <b><a href="qlistwidget.html#itemWidget">itemWidget</a></b> (<i>self</i>, QListWidgetItem <i>item</i>)</li><li><div class="fn" />QMimeData <b><a href="qlistwidget.html#mimeData">mimeData</a></b> (<i>self</i>, QListWidgetItem-list <i>items</i>)</li><li><div class="fn" />QStringList <b><a href="qlistwidget.html#mimeTypes">mimeTypes</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qlistwidget.html#openPersistentEditor">openPersistentEditor</a></b> (<i>self</i>, QListWidgetItem <i>item</i>)</li><li><div class="fn" />int <b><a href="qlistwidget.html#row">row</a></b> (<i>self</i>, QListWidgetItem <i>item</i>)</li><li><div class="fn" /><b><a href="qlistwidget.html#scrollToItem">scrollToItem</a></b> (<i>self</i>, QListWidgetItem <i>item</i>, QAbstractItemView.ScrollHint <i>hint</i> = QAbstractItemView.EnsureVisible)</li><li><div class="fn" />QListWidgetItem-list <b><a href="qlistwidget.html#selectedItems">selectedItems</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qlistwidget.html#setCurrentItem">setCurrentItem</a></b> (<i>self</i>, QListWidgetItem <i>item</i>)</li><li><div class="fn" /><b><a href="qlistwidget.html#setCurrentRow">setCurrentRow</a></b> (<i>self</i>, int <i>row</i>)</li><li><div class="fn" /><b><a href="qlistwidget.html#setItemHidden">setItemHidden</a></b> (<i>self</i>, QListWidgetItem <i>item</i>, bool <i>hide</i>)</li><li><div class="fn" /><b><a href="qlistwidget.html#setItemSelected">setItemSelected</a></b> (<i>self</i>, QListWidgetItem <i>item</i>, bool <i>select</i>)</li><li><div class="fn" /><b><a href="qlistwidget.html#setItemWidget">setItemWidget</a></b> (<i>self</i>, QListWidgetItem <i>item</i>, QWidget <i>widget</i>)</li><li><div class="fn" /><b><a href="qlistwidget.html#sortItems">sortItems</a></b> (<i>self</i>, Qt.SortOrder <i>order</i> = Qt.AscendingOrder)</li><li><div class="fn" />Qt.DropActions <b><a href="qlistwidget.html#supportedDropActions">supportedDropActions</a></b> (<i>self</i>)</li><li><div class="fn" />QListWidgetItem <b><a href="qlistwidget.html#takeItem">takeItem</a></b> (<i>self</i>, int <i>row</i>)</li><li><div class="fn" />QRect <b><a href="qlistwidget.html#visualItemRect">visualItemRect</a></b> (<i>self</i>, QListWidgetItem <i>item</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qlistwidget.html#currentItemChanged">currentItemChanged</a></b> (QListWidgetItem *,QListWidgetItem *)</li><li><div class="fn" />void <b><a href="qlistwidget.html#currentRowChanged">currentRowChanged</a></b> (int)</li><li><div class="fn" />void <b><a href="qlistwidget.html#currentTextChanged">currentTextChanged</a></b> (const QString&)</li><li><div class="fn" />void <b><a href="qlistwidget.html#itemActivated">itemActivated</a></b> (QListWidgetItem *)</li><li><div class="fn" />void <b><a href="qlistwidget.html#itemChanged">itemChanged</a></b> (QListWidgetItem *)</li><li><div class="fn" />void <b><a href="qlistwidget.html#itemClicked">itemClicked</a></b> (QListWidgetItem *)</li><li><div class="fn" />void <b><a href="qlistwidget.html#itemDoubleClicked">itemDoubleClicked</a></b> (QListWidgetItem *)</li><li><div class="fn" />void <b><a href="qlistwidget.html#itemEntered">itemEntered</a></b> (QListWidgetItem *)</li><li><div class="fn" />void <b><a href="qlistwidget.html#itemPressed">itemPressed</a></b> (QListWidgetItem *)</li><li><div class="fn" />void <b><a href="qlistwidget.html#itemSelectionChanged">itemSelectionChanged</a></b> ()</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QListWidget class provides an item-based list widget.</p>
<p>QListWidget is a convenience class that provides a list view similar to the one supplied by <a href="qlistview.html">QListView</a>, but with a classic item-based interface for adding and removing items. QListWidget uses an internal model to manage each <a href="qlistwidgetitem.html">QListWidgetItem</a> in the list.</p>
<p>For a more flexible list view widget, use the <a href="qlistview.html">QListView</a> class with a standard model.</p>
<p>List widgets are constructed in the same way as other widgets:</p>
<pre>
QListWidget *listWidget = new QListWidget(this);
</pre>
<p>The <a href="qabstractitemview.html#selectionMode-prop">selectionMode</a>() of a list widget determines how many of the items in the list can be selected at the same time, and whether complex selections of items can be created. This can be set with the <a href="qabstractitemview.html#selectionMode-prop">setSelectionMode</a>() function.</p>
<p>There are two ways to add items to the list: they can be constructed with the list widget as their parent widget, or they can be constructed with no parent widget and added to the list later. If a list widget already exists when the items are constructed, the first method is easier to use:</p>
<pre>
new QListWidgetItem(tr("Oak"), listWidget);
new QListWidgetItem(tr("Fir"), listWidget);
new QListWidgetItem(tr("Pine"), listWidget);
</pre>
<p>If you need to insert a new item into the list at a particular position, it is more convenient to construct the item without a parent widget and use the <a href="qlistwidget.html#insertItem">insertItem</a>() function to place it within the list:</p>
<pre>
QListWidgetItem *newItem = new QListWidgetItem;
newItem->setText(itemText);
listWidget->insertItem(row, newItem);
</pre>
<p>For multiple items, <a href="qlistwidget.html#insertItems">insertItems</a>() can be used instead. The number of items in the list is found with the <a href="qlistwidget.html#count-prop">count</a>() function. To remove items from the list, use <a href="qlistwidget.html#takeItem">takeItem</a>().</p>
<p>The current item in the list can be found with <a href="qlistwidget.html#currentItem">currentItem</a>(), and changed with <a href="qlistwidget.html#setCurrentItem">setCurrentItem</a>(). The user can also change the current item by navigating with the keyboard or clicking on a different item. When the current item changes, the <a href="qlistwidget.html#currentItemChanged">currentItemChanged</a>() signal is emitted with the new current item and the item that was previously current.</p>
<table align="center" border="0" cellpadding="2" cellspacing="1" width="100%">
<tr bgcolor="#F0F0F0" valign="top">
<td><img alt="Screenshot of a Windows XP style list widget" src="images/windowsxp-listview.png" /></td>
<td><img alt="Screenshot of a Macintosh style table widget" src="images/macintosh-listview.png" /></td>
<td><img alt="Screenshot of a Plastique style table widget" src="images/plastique-listview.png" /></td>
</tr>
<tr bgcolor="#E0E0E0" valign="top">
<td>A <a href="gallery-windowsxp.html">Windows XP style</a> list widget.</td>
<td>A <a href="gallery-macintosh.html">Macintosh style</a> list widget.</td>
<td>A <a href="gallery-plastique.html">Plastique style</a> list widget.</td>
</tr>
</table>
<br />
<br />
<p>See also <a href="qlistwidgetitem.html">QListWidgetItem</a>, <a href="qlistview.html">QListView</a>, <a href="qtreeview.html">QTreeView</a>, and <a href="model-view-programming.html">Model/View Programming</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QListWidget" />QListWidget.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a> <i>parent</i> = None)</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 <a href="qlistwidget.html">QListWidget</a> with the given <i>parent</i>.</p>
<h3 class="fn"><a name="addItem" />QListWidget.addItem (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>aitem</i>)</h3><p>The <i>aitem</i> argument has it's ownership transferred to Qt.</p><p>Inserts an item with the text <i>label</i> at the end of the list widget.</p>
<h3 class="fn"><a name="addItem-2" />QListWidget.addItem (<i>self</i>, <a href="qstring.html">QString</a> <i>label</i>)</h3><p>This is an overloaded member function, provided for convenience.</p>
<p>Inserts the <i>item</i> at the the end of the list widget.</p>
<p>See also <a href="qlistwidget.html#insertItem">insertItem</a>().</p>
<h3 class="fn"><a name="addItems" />QListWidget.addItems (<i>self</i>, <a href="qstringlist.html">QStringList</a> <i>labels</i>)</h3><p>Inserts items with the text <i>labels</i> at the end of the list widget.</p>
<p>See also <a href="qlistwidget.html#insertItems">insertItems</a>().</p>
<h3 class="fn"><a name="clear" />QListWidget.clear (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void clear()</tt>.</p><p>Removes all items and selections in the view.</p>
<h3 class="fn"><a name="closePersistentEditor" />QListWidget.closePersistentEditor (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>item</i>)</h3><p>Closes the persistent editor for the given <i>item</i>.</p>
<p>See also <a href="qlistwidget.html#openPersistentEditor">openPersistentEditor</a>().</p>
<h3 class="fn"><a name="count" />int QListWidget.count (<i>self</i>)</h3><h3 class="fn"><a name="currentItem" /><a href="qlistwidgetitem.html">QListWidgetItem</a> QListWidget.currentItem (<i>self</i>)</h3><p>Returns the current item.</p>
<p>See also <a href="qlistwidget.html#setCurrentItem">setCurrentItem</a>().</p>
<h3 class="fn"><a name="currentRow" />int QListWidget.currentRow (<i>self</i>)</h3><h3 class="fn"><a name="dropMimeData" />bool QListWidget.dropMimeData (<i>self</i>, int <i>index</i>, <a href="qmimedata.html">QMimeData</a> <i>data</i>, <a href="qt.html#DropAction-enum">Qt.DropAction</a> <i>action</i>)</h3><p>Handles the <i>data</i> supplied by a drag and drop operation that ended with the given <i>action</i> in the given <i>index</i>.</p>
<p>See also <a href="qlistwidget.html#supportedDropActions">supportedDropActions</a>().</p>
<h3 class="fn"><a name="editItem" />QListWidget.editItem (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>item</i>)</h3><p>Starts editing the <i>item</i> if it is editable.</p>
<h3 class="fn"><a name="event" />bool QListWidget.event (<i>self</i>, <a href="qevent.html">QEvent</a> <i>e</i>)</h3><h3 class="fn"><a name="findItems" />QListWidgetItem-list QListWidget.findItems (<i>self</i>, <a href="qstring.html">QString</a> <i>text</i>, <a href="qt-matchflags.html">Qt.MatchFlags</a> <i>flags</i>)</h3><p>Finds items with the text that matches the string <i>text</i> using the given <i>flags</i>.</p>
<h3 class="fn"><a name="indexFromItem" /><a href="qmodelindex.html">QModelIndex</a> QListWidget.indexFromItem (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>item</i>)</h3><p>Returns the <a href="qmodelindex.html">QModelIndex</a> assocated with the given <i>item</i>.</p>
<h3 class="fn"><a name="insertItem" />QListWidget.insertItem (<i>self</i>, int <i>row</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>item</i>)</h3><p>The <i>item</i> argument has it's ownership transferred to Qt.</p><p>Inserts the <i>item</i> at the position in the list given by <i>row</i>.</p>
<p>See also <a href="qlistwidget.html#addItem">addItem</a>().</p>
<h3 class="fn"><a name="insertItem-2" />QListWidget.insertItem (<i>self</i>, int <i>row</i>, <a href="qstring.html">QString</a> <i>label</i>)</h3><p>This is an overloaded member function, provided for convenience.</p>
<p>Inserts an item with the text <i>label</i> in the list widget at the position given by <i>row</i>.</p>
<p>See also <a href="qlistwidget.html#addItem">addItem</a>().</p>
<h3 class="fn"><a name="insertItems" />QListWidget.insertItems (<i>self</i>, int <i>row</i>, <a href="qstringlist.html">QStringList</a> <i>labels</i>)</h3><p>Inserts items from the list of <i>labels</i> into the list, starting at the given <i>row</i>.</p>
<p>See also <a href="qlistwidget.html#insertItem">insertItem</a>() and <a href="qlistwidget.html#addItem">addItem</a>().</p>
<h3 class="fn"><a name="isItemHidden" />bool QListWidget.isItemHidden (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>item</i>)</h3><p>Returns true if the <i>item</i> is explicitly hidden; otherwise returns false.</p>
<h3 class="fn"><a name="isItemSelected" />bool QListWidget.isItemSelected (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>item</i>)</h3><p>Returns true if <i>item</i> is selected; otherwise returns false.</p>
<h3 class="fn"><a name="item" /><a href="qlistwidgetitem.html">QListWidgetItem</a> QListWidget.item (<i>self</i>, int <i>row</i>)</h3><p>Returns the item that occupies the given <i>row</i> in the list if one has been set; otherwise returns 0.</p>
<p>See also <a href="qlistwidget.html#row">row</a>().</p>
<h3 class="fn"><a name="itemAt" /><a href="qlistwidgetitem.html">QListWidgetItem</a> QListWidget.itemAt (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>p</i>)</h3><p>Returns a pointer to the item at the coordinates <i>p</i>.</p>
<h3 class="fn"><a name="itemAt-2" /><a href="qlistwidgetitem.html">QListWidgetItem</a> QListWidget.itemAt (<i>self</i>, int <i>ax</i>, int <i>ay</i>)</h3><p>This is an overloaded member function, provided for convenience.</p>
<p>Returns a pointer to the item at the coordinates (<i>x</i>, <i>y</i>).</p>
<h3 class="fn"><a name="itemFromIndex" /><a href="qlistwidgetitem.html">QListWidgetItem</a> QListWidget.itemFromIndex (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a> <i>index</i>)</h3><p>Returns a pointer to the <a href="qlistwidgetitem.html">QListWidgetItem</a> assocated with the given <i>index</i>.</p>
<h3 class="fn"><a name="items" />QListWidgetItem-list QListWidget.items (<i>self</i>, <a href="qmimedata.html">QMimeData</a> <i>data</i>)</h3><p>Returns a list of pointers to the items contained in the <i>data</i> object. If the object was not created by a <a href="qlistwidget.html">QListWidget</a> in the same process, the list is empty.</p>
<h3 class="fn"><a name="itemWidget" /><a href="qwidget.html">QWidget</a> QListWidget.itemWidget (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>item</i>)</h3><p>Returns the widget displayed in the given <i>item</i>.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qlistwidget.html#setItemWidget">setItemWidget</a>().</p>
<h3 class="fn"><a name="mimeData" /><a href="qmimedata.html">QMimeData</a> QListWidget.mimeData (<i>self</i>, QListWidgetItem-list <i>items</i>)</h3><p>The <i>QMimeData</i> result</p><p>Returns an object that contains a serialized description of the specified <i>items</i>. The format used to describe the items is obtained from the <a href="qlistwidget.html#mimeTypes">mimeTypes</a>() function.</p>
<p>If the list of items is empty, 0 is returned rather than a serialized empty list.</p>
<h3 class="fn"><a name="mimeTypes" /><a href="qstringlist.html">QStringList</a> QListWidget.mimeTypes (<i>self</i>)</h3><p>Returns a list of MIME types that can be used to describe a list of listwidget items.</p>
<p>See also <a href="qlistwidget.html#mimeData">mimeData</a>().</p>
<h3 class="fn"><a name="openPersistentEditor" />QListWidget.openPersistentEditor (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>item</i>)</h3><p>Opens an editor for the given <i>item</i>. The editor remains open after editing.</p>
<p>See also <a href="qlistwidget.html#closePersistentEditor">closePersistentEditor</a>().</p>
<h3 class="fn"><a name="row" />int QListWidget.row (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>item</i>)</h3><p>Returns the row containing the given <i>item</i>.</p>
<p>See also <a href="qlistwidget.html#item">item</a>().</p>
<h3 class="fn"><a name="scrollToItem" />QListWidget.scrollToItem (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>item</i>, <a href="qabstractitemview.html#ScrollHint-enum">QAbstractItemView.ScrollHint</a> <i>hint</i> = QAbstractItemView.EnsureVisible)</h3><p>This method is also a Qt slot with the C++ signature <tt>void scrollToItem(const QListWidgetItem *,QAbstractItemView::ScrollHint = QAbstractItemView.EnsureVisible)</tt>.</p><p>Scrolls the view if necessary to ensure that the <i>item</i> is visible. The <i>hint</i> parameter specifies more precisely where the <i>item</i> should be located after the operation.</p>
<h3 class="fn"><a name="selectedItems" />QListWidgetItem-list QListWidget.selectedItems (<i>self</i>)</h3><p>Returns a list of all selected items in the list widget.</p>
<h3 class="fn"><a name="setCurrentItem" />QListWidget.setCurrentItem (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>item</i>)</h3><p>Sets the current item to <i>item</i>.</p>
<p>Depending on the current selection mode, the item may also be selected.</p>
<p>See also <a href="qlistwidget.html#currentItem">currentItem</a>().</p>
<h3 class="fn"><a name="setCurrentRow" />QListWidget.setCurrentRow (<i>self</i>, int <i>row</i>)</h3><h3 class="fn"><a name="setItemHidden" />QListWidget.setItemHidden (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>item</i>, bool <i>hide</i>)</h3><p>If <i>hide</i> is true, the <i>item</i> will be hidden; otherwise it will be shown.</p>
<p>See also <a href="qlistwidget.html#isItemHidden">isItemHidden</a>().</p>
<h3 class="fn"><a name="setItemSelected" />QListWidget.setItemSelected (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>item</i>, bool <i>select</i>)</h3><p>Selects or deselects the given <i>item</i> depending on whether <i>select</i> is true of false.</p>
<p>See also <a href="qlistwidget.html#isItemSelected">isItemSelected</a>().</p>
<h3 class="fn"><a name="setItemWidget" />QListWidget.setItemWidget (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>item</i>, <a href="qwidget.html">QWidget</a> <i>widget</i>)</h3><p>Sets the <i>widget</i> to be displayed in the give <i>item</i>.</p>
<p>This function should only be used to display static content in the place of a list widget item. If you want to display custom dynamic content or implement a custom editor widget, use <a href="qlistview.html">QListView</a> and subclass <a href="qitemdelegate.html">QItemDelegate</a> instead.</p>
<p>This function was introduced in Qt 4.1.</p>
<p>See also <a href="qlistwidget.html#itemWidget">itemWidget</a>() and <a href="model-view-delegate.html">Delegate Classes</a>.</p>
<h3 class="fn"><a name="sortItems" />QListWidget.sortItems (<i>self</i>, <a href="qt.html#SortOrder-enum">Qt.SortOrder</a> <i>order</i> = Qt.AscendingOrder)</h3><p>Sorts all the items in the list widget according to the specified <i>order</i>.</p>
<h3 class="fn"><a name="supportedDropActions" /><a href="qt-dropactions.html">Qt.DropActions</a> QListWidget.supportedDropActions (<i>self</i>)</h3><p>Returns the drop actions supported by this view.</p>
<p>See also <a href="qt.html#DropAction-enum">Qt.DropActions</a>.</p>
<h3 class="fn"><a name="takeItem" /><a href="qlistwidgetitem.html">QListWidgetItem</a> QListWidget.takeItem (<i>self</i>, int <i>row</i>)</h3><p>The <i>QListWidgetItem</i> result</p><p>Removes and returns the item from the given <i>row</i> in the list widget; otherwise returns 0.</p>
<p>Items removed from a list widget will not be managed by Qt, and will need to be deleted manually.</p>
<p>See also <a href="qlistwidget.html#insertItem">insertItem</a>() and <a href="qlistwidget.html#addItem">addItem</a>().</p>
<h3 class="fn"><a name="visualItemRect" /><a href="qrect.html">QRect</a> QListWidget.visualItemRect (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> <i>item</i>)</h3><p>Returns the rectangle on the viewport occupied by the item at <i>item</i>.</p>
<hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="currentItemChanged" />void currentItemChanged (QListWidgetItem *,QListWidgetItem *)</h3><p>This signal is emitted whenever the current item changes. The <i>previous</i> item is the item that previously had the focus, <i>current</i> is the new current item.</p>
<h3 class="fn"><a name="currentRowChanged" />void currentRowChanged (int)</h3><p>This signal is emitted whenever the current item changes. The <i>currentRow</i> is the row of the current item. If there is no current item, the <i>currentRow</i> is -1.</p>
<h3 class="fn"><a name="currentTextChanged" />void currentTextChanged (const QString&)</h3><p>This signal is emitted whenever the current item changes. The <i>currentText</i> is the text data in the current item. If there is no current item, the <i>currentText</i> is invalid.</p>
<h3 class="fn"><a name="itemActivated" />void itemActivated (QListWidgetItem *)</h3><p>This signal is emitted when the <i>item</i> is activated. The <i>item</i> is activated when the user clicks or double clicks on it, depending on the system configuration. It is also activated when the user presses the activation key (on Windows and X11 this is the <b>Return</b> key, on Mac OS X it is <b>Ctrl+0</b>).</p>
<h3 class="fn"><a name="itemChanged" />void itemChanged (QListWidgetItem *)</h3><p>This signal is emitted whenever the data of <i>item</i> has changed.</p>
<h3 class="fn"><a name="itemClicked" />void itemClicked (QListWidgetItem *)</h3><p>This signal is emitted when a mouse button is clicked.</p>
<h3 class="fn"><a name="itemDoubleClicked" />void itemDoubleClicked (QListWidgetItem *)</h3><p>This signal is emitted when a mouse button is double clicked.</p>
<h3 class="fn"><a name="itemEntered" />void itemEntered (QListWidgetItem *)</h3><p>This signal is emitted when the mouse cursor enters an item. The <i>item</i> is the item entered. This signal is only emitted when <a href="qwidget.html#mouseTracking-prop">mouseTracking</a> is turned on, or when a mouse button is pressed while moving into an item.</p>
<h3 class="fn"><a name="itemPressed" />void itemPressed (QListWidgetItem *)</h3><p>This signal is emitted when an item has been pressed (mouse click and release).</p>
<h3 class="fn"><a name="itemSelectionChanged" />void itemSelectionChanged ()</h3><p>This signal is emitted whenever the selection changes.</p>
<p>See also <a href="qlistwidget.html#selectedItems">selectedItems</a>(), <a href="qlistwidget.html#isItemSelected">isItemSelected</a>(), and <a href="qlistwidget.html#currentItemChanged">currentItemChanged</a>().</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td width="25%">PyQt 4.0.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.trolltech.com">Trolltech AS</a> 2006</td><td align="right" width="25%">Qt 4.1.4</td></tr></table></div></address></body></html>
|