~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/qlistwidget.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/gui/itemviews/qlistwidget.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: QListWidget Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">QListWidget Class Reference</h1>
 
21
<p>The QListWidget class provides an item-based list widget. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;QListWidget&gt;</pre><p>Part of the <a href="qtgui.html">QtGui</a> module.</p>
 
23
<p>Inherits <a href="qlistview.html">QListView</a>.</p>
 
24
<ul>
 
25
<li><a href="qlistwidget-members.html">List of all members, including inherited members</a></li>
 
26
</ul>
 
27
<a name="properties"></a>
 
28
<h3>Properties</h3>
 
29
<ul>
 
30
<li><div class="fn"/><b><a href="qlistwidget.html#count-prop">count</a></b> : const int</li>
 
31
<li><div class="fn"/><b><a href="qlistwidget.html#currentRow-prop">currentRow</a></b> : int</li>
 
32
</ul>
 
33
<ul>
 
34
<li><div class="fn"/>9 properties inherited from <a href="qlistview.html#properties">QListView</a></li>
 
35
<li><div class="fn"/>10 properties inherited from <a href="qabstractitemview.html#properties">QAbstractItemView</a></li>
 
36
<li><div class="fn"/>2 properties inherited from <a href="qabstractscrollarea.html#properties">QAbstractScrollArea</a></li>
 
37
<li><div class="fn"/>6 properties inherited from <a href="qframe.html#properties">QFrame</a></li>
 
38
<li><div class="fn"/>52 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
 
39
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
 
40
</ul>
 
41
<a name="public-functions"></a>
 
42
<h3>Public Functions</h3>
 
43
<ul>
 
44
<li><div class="fn"/><b><a href="qlistwidget.html#QListWidget">QListWidget</a></b> ( QWidget * <i>parent</i> = 0 )</li>
 
45
<li><div class="fn"/><b><a href="qlistwidget.html#dtor.QListWidget">~QListWidget</a></b> ()</li>
 
46
<li><div class="fn"/>void <b><a href="qlistwidget.html#addItem">addItem</a></b> ( const QString &amp; <i>label</i> )</li>
 
47
<li><div class="fn"/>void <b><a href="qlistwidget.html#addItem-2">addItem</a></b> ( QListWidgetItem * <i>item</i> )</li>
 
48
<li><div class="fn"/>void <b><a href="qlistwidget.html#addItems">addItems</a></b> ( const QStringList &amp; <i>labels</i> )</li>
 
49
<li><div class="fn"/>void <b><a href="qlistwidget.html#closePersistentEditor">closePersistentEditor</a></b> ( QListWidgetItem * <i>item</i> )</li>
 
50
<li><div class="fn"/>int <b><a href="qlistwidget.html#count-prop">count</a></b> () const</li>
 
51
<li><div class="fn"/>QListWidgetItem * <b><a href="qlistwidget.html#currentItem">currentItem</a></b> () const</li>
 
52
<li><div class="fn"/>int <b><a href="qlistwidget.html#currentRow-prop">currentRow</a></b> () const</li>
 
53
<li><div class="fn"/>void <b><a href="qlistwidget.html#editItem">editItem</a></b> ( QListWidgetItem * <i>item</i> )</li>
 
54
<li><div class="fn"/>QList&lt;QListWidgetItem *&gt; <b><a href="qlistwidget.html#findItems">findItems</a></b> ( const QString &amp; <i>text</i>, Qt::MatchFlags <i>flags</i> ) const</li>
 
55
<li><div class="fn"/>void <b><a href="qlistwidget.html#insertItem">insertItem</a></b> ( int <i>row</i>, QListWidgetItem * <i>item</i> )</li>
 
56
<li><div class="fn"/>void <b><a href="qlistwidget.html#insertItem-2">insertItem</a></b> ( int <i>row</i>, const QString &amp; <i>label</i> )</li>
 
57
<li><div class="fn"/>void <b><a href="qlistwidget.html#insertItems">insertItems</a></b> ( int <i>row</i>, const QStringList &amp; <i>labels</i> )</li>
 
58
<li><div class="fn"/>bool <b><a href="qlistwidget.html#isItemHidden">isItemHidden</a></b> ( const QListWidgetItem * <i>item</i> ) const</li>
 
59
<li><div class="fn"/>bool <b><a href="qlistwidget.html#isItemSelected">isItemSelected</a></b> ( const QListWidgetItem * <i>item</i> ) const</li>
 
60
<li><div class="fn"/>QListWidgetItem * <b><a href="qlistwidget.html#item">item</a></b> ( int <i>row</i> ) const</li>
 
61
<li><div class="fn"/>QListWidgetItem * <b><a href="qlistwidget.html#itemAt">itemAt</a></b> ( const QPoint &amp; <i>p</i> ) const</li>
 
62
<li><div class="fn"/>QListWidgetItem * <b><a href="qlistwidget.html#itemAt-2">itemAt</a></b> ( int <i>x</i>, int <i>y</i> ) const</li>
 
63
<li><div class="fn"/>void <b><a href="qlistwidget.html#openPersistentEditor">openPersistentEditor</a></b> ( QListWidgetItem * <i>item</i> )</li>
 
64
<li><div class="fn"/>int <b><a href="qlistwidget.html#row">row</a></b> ( const QListWidgetItem * <i>item</i> ) const</li>
 
65
<li><div class="fn"/>QList&lt;QListWidgetItem *&gt; <b><a href="qlistwidget.html#selectedItems">selectedItems</a></b> () const</li>
 
66
<li><div class="fn"/>void <b><a href="qlistwidget.html#setCurrentItem">setCurrentItem</a></b> ( QListWidgetItem * <i>item</i> )</li>
 
67
<li><div class="fn"/>void <b><a href="qlistwidget.html#currentRow-prop">setCurrentRow</a></b> ( int <i>row</i> )</li>
 
68
<li><div class="fn"/>void <b><a href="qlistwidget.html#setItemHidden">setItemHidden</a></b> ( const QListWidgetItem * <i>item</i>, bool <i>hide</i> )</li>
 
69
<li><div class="fn"/>void <b><a href="qlistwidget.html#setItemSelected">setItemSelected</a></b> ( const QListWidgetItem * <i>item</i>, bool <i>select</i> )</li>
 
70
<li><div class="fn"/>void <b><a href="qlistwidget.html#sortItems">sortItems</a></b> ( Qt::SortOrder <i>order</i> = Qt::AscendingOrder )</li>
 
71
<li><div class="fn"/>QListWidgetItem * <b><a href="qlistwidget.html#takeItem">takeItem</a></b> ( int <i>row</i> )</li>
 
72
<li><div class="fn"/>QRect <b><a href="qlistwidget.html#visualItemRect">visualItemRect</a></b> ( const QListWidgetItem * <i>item</i> ) const</li>
 
73
</ul>
 
74
<ul>
 
75
<li><div class="fn"/>21 public functions inherited from <a href="qlistview.html#public-functions">QListView</a></li>
 
76
<li><div class="fn"/>37 public functions inherited from <a href="qabstractitemview.html#public-functions">QAbstractItemView</a></li>
 
77
<li><div class="fn"/>8 public functions inherited from <a href="qabstractscrollarea.html#public-functions">QAbstractScrollArea</a></li>
 
78
<li><div class="fn"/>13 public functions inherited from <a href="qframe.html#public-functions">QFrame</a></li>
 
79
<li><div class="fn"/>183 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
 
80
<li><div class="fn"/>28 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
 
81
<li><div class="fn"/>10 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
 
82
</ul>
 
83
<a name="public-slots"></a>
 
84
<h3>Public Slots</h3>
 
85
<ul>
 
86
<li><div class="fn"/>void <b><a href="qlistwidget.html#clear">clear</a></b> ()</li>
 
87
<li><div class="fn"/>void <b><a href="qlistwidget.html#scrollToItem">scrollToItem</a></b> ( const QListWidgetItem * <i>item</i>, ScrollHint <i>hint</i> = EnsureVisible )</li>
 
88
</ul>
 
89
<ul>
 
90
<li><div class="fn"/>6 public slots inherited from <a href="qabstractitemview.html#public-slots">QAbstractItemView</a></li>
 
91
<li><div class="fn"/>17 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
 
92
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
 
93
</ul>
 
94
<a name="signals"></a>
 
95
<h3>Signals</h3>
 
96
<ul>
 
97
<li><div class="fn"/>void <b><a href="qlistwidget.html#currentItemChanged">currentItemChanged</a></b> ( QListWidgetItem * <i>current</i>, QListWidgetItem * <i>previous</i> )</li>
 
98
<li><div class="fn"/>void <b><a href="qlistwidget.html#currentRowChanged">currentRowChanged</a></b> ( int <i>currentRow</i> )</li>
 
99
<li><div class="fn"/>void <b><a href="qlistwidget.html#currentTextChanged">currentTextChanged</a></b> ( const QString &amp; <i>currentText</i> )</li>
 
100
<li><div class="fn"/>void <b><a href="qlistwidget.html#itemActivated">itemActivated</a></b> ( QListWidgetItem * <i>item</i> )</li>
 
101
<li><div class="fn"/>void <b><a href="qlistwidget.html#itemChanged">itemChanged</a></b> ( QListWidgetItem * <i>item</i> )</li>
 
102
<li><div class="fn"/>void <b><a href="qlistwidget.html#itemClicked">itemClicked</a></b> ( QListWidgetItem * <i>item</i> )</li>
 
103
<li><div class="fn"/>void <b><a href="qlistwidget.html#itemDoubleClicked">itemDoubleClicked</a></b> ( QListWidgetItem * <i>item</i> )</li>
 
104
<li><div class="fn"/>void <b><a href="qlistwidget.html#itemEntered">itemEntered</a></b> ( QListWidgetItem * <i>item</i> )</li>
 
105
<li><div class="fn"/>void <b><a href="qlistwidget.html#itemPressed">itemPressed</a></b> ( QListWidgetItem * <i>item</i> )</li>
 
106
<li><div class="fn"/>void <b><a href="qlistwidget.html#itemSelectionChanged">itemSelectionChanged</a></b> ()</li>
 
107
</ul>
 
108
<ul>
 
109
<li><div class="fn"/>6 signals inherited from <a href="qabstractitemview.html#signals">QAbstractItemView</a></li>
 
110
<li><div class="fn"/>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
 
111
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
 
112
</ul>
 
113
<a name="protected-functions"></a>
 
114
<h3>Protected Functions</h3>
 
115
<ul>
 
116
<li><div class="fn"/>virtual bool <b><a href="qlistwidget.html#dropMimeData">dropMimeData</a></b> ( int <i>index</i>, const QMimeData * <i>data</i>, Qt::DropAction <i>action</i> )</li>
 
117
<li><div class="fn"/>QModelIndex <b><a href="qlistwidget.html#indexFromItem">indexFromItem</a></b> ( QListWidgetItem * <i>item</i> ) const</li>
 
118
<li><div class="fn"/>QListWidgetItem * <b><a href="qlistwidget.html#itemFromIndex">itemFromIndex</a></b> ( const QModelIndex &amp; <i>index</i> ) const</li>
 
119
<li><div class="fn"/>QList&lt;QListWidgetItem *&gt; <b><a href="qlistwidget.html#items">items</a></b> ( const QMimeData * <i>data</i> ) const</li>
 
120
<li><div class="fn"/>virtual QMimeData * <b><a href="qlistwidget.html#mimeData">mimeData</a></b> ( const QList&lt;QListWidgetItem *&gt; <i>items</i> ) const</li>
 
121
<li><div class="fn"/>virtual QStringList <b><a href="qlistwidget.html#mimeTypes">mimeTypes</a></b> () const</li>
 
122
<li><div class="fn"/>virtual Qt::DropActions <b><a href="qlistwidget.html#supportedDropActions">supportedDropActions</a></b> () const</li>
 
123
</ul>
 
124
<ul>
 
125
<li><div class="fn"/>1 protected function inherited from <a href="qlistview.html#protected-functions">QListView</a></li>
 
126
<li><div class="fn"/>35 protected functions inherited from <a href="qabstractitemview.html#protected-functions">QAbstractItemView</a></li>
 
127
<li><div class="fn"/>17 protected functions inherited from <a href="qabstractscrollarea.html#protected-functions">QAbstractScrollArea</a></li>
 
128
<li><div class="fn"/>39 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
 
129
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
 
130
</ul>
 
131
<h3>Additional Inherited Members</h3>
 
132
<ul>
 
133
<li><div class="fn"/>2 static public members inherited from <a href="qframe.html#static-public-members">QFrame</a></li>
 
134
<li><div class="fn"/>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
 
135
<li><div class="fn"/>4 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
 
136
<li><div class="fn"/>8 protected slots inherited from <a href="qabstractitemview.html#protected-slots">QAbstractItemView</a></li>
 
137
</ul>
 
138
<a name="details"></a>
 
139
<hr />
 
140
<h2>Detailed Description</h2>
 
141
<p>The QListWidget class provides an item-based list widget.</p>
 
142
<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>
 
143
<p>For a more flexible list view widget, use the <a href="qlistview.html">QListView</a> class with a standard model.</p>
 
144
<p>List widgets are constructed in the same way as other widgets:</p>
 
145
<pre>&nbsp;       QListWidget *listWidget;</pre>
 
146
<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>
 
147
<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>
 
148
<pre>&nbsp;       new QListWidgetItem(tr(&quot;Oak&quot;), listWidget);
 
149
        new QListWidgetItem(tr(&quot;Fir&quot;), listWidget);
 
150
        new QListWidgetItem(tr(&quot;Pine&quot;), listWidget);</pre>
 
151
<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>
 
152
<pre>&nbsp;       QListWidgetItem *newItem = new QListWidgetItem;
 
153
        newItem-&gt;setText(itemText);
 
154
        listWidget-&gt;insertItem(row, newItem);</pre>
 
155
<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 removeItem().</p>
 
156
<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>
 
157
<p>See also <a href="qlistwidgetitem.html">QListWidgetItem</a> and <a href="model-view-programming.html">Model/View Programming</a>.</p>
 
158
<hr />
 
159
<h2>Property Documentation</h2>
 
160
<h3 class="fn"><a name="count-prop"></a>count : const int</h3>
 
161
<p>This property holds the number of items in the list including any hidden items.</p>
 
162
<p>Access functions:</p>
 
163
<ul>
 
164
<li><div class="fn"/><b>int count () const</b></li>
 
165
</ul>
 
166
<h3 class="fn"><a name="currentRow-prop"></a>currentRow : int</h3>
 
167
<p>This property holds the row of the current item.</p>
 
168
<p>Access functions:</p>
 
169
<ul>
 
170
<li><div class="fn"/><b>int currentRow () const</b></li>
 
171
<li><div class="fn"/><b>void setCurrentRow ( int <i>row</i> )</b></li>
 
172
</ul>
 
173
<hr />
 
174
<h2>Member Function Documentation</h2>
 
175
<h3 class="fn"><a name="QListWidget"></a>QListWidget::QListWidget ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
 
176
<p>Constructs an empty <a href="qlistwidget.html">QListWidget</a> with the given <i>parent</i>.</p>
 
177
<h3 class="fn"><a name="dtor.QListWidget"></a>QListWidget::~QListWidget ()</h3>
 
178
<p>Destroys the list widget and all its items.</p>
 
179
<h3 class="fn"><a name="addItem"></a>void QListWidget::addItem ( const <a href="qstring.html">QString</a> &amp; <i>label</i> )</h3>
 
180
<p>Inserts an item with the text <i>label</i> at the end of the list widget.</p>
 
181
<h3 class="fn"><a name="addItem-2"></a>void QListWidget::addItem ( <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i> )</h3>
 
182
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
183
<p>Inserts the <i>item</i> at the the end of the list widget.</p>
 
184
<p>See also <a href="qlistwidget.html#insertItem">insertItem</a>().</p>
 
185
<h3 class="fn"><a name="addItems"></a>void QListWidget::addItems ( const <a href="qstringlist.html">QStringList</a> &amp; <i>labels</i> )</h3>
 
186
<p>Inserts items with the text <i>labels</i> at the end of the list widget.</p>
 
187
<p>See also <a href="qlistwidget.html#insertItems">insertItems</a>().</p>
 
188
<h3 class="fn"><a name="clear"></a>void QListWidget::clear ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
 
189
<p>Removes all items and selections in the view.</p>
 
190
<h3 class="fn"><a name="closePersistentEditor"></a>void QListWidget::closePersistentEditor ( <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i> )</h3>
 
191
<p>Closes the persistent editor for the given <i>item</i>.</p>
 
192
<p>See also <a href="qlistwidget.html#openPersistentEditor">openPersistentEditor</a>().</p>
 
193
<h3 class="fn"><a name="currentItem"></a><a href="qlistwidgetitem.html">QListWidgetItem</a> * QListWidget::currentItem () const</h3>
 
194
<p>Returns the current item.</p>
 
195
<h3 class="fn"><a name="currentItemChanged"></a>void QListWidget::currentItemChanged ( <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>current</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>previous</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
196
<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>
 
197
<h3 class="fn"><a name="currentRowChanged"></a>void QListWidget::currentRowChanged ( int <i>currentRow</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
198
<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>
 
199
<h3 class="fn"><a name="currentTextChanged"></a>void QListWidget::currentTextChanged ( const <a href="qstring.html">QString</a> &amp; <i>currentText</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
200
<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>
 
201
<h3 class="fn"><a name="dropMimeData"></a>bool QListWidget::dropMimeData ( int <i>index</i>, const <a href="qmimedata.html">QMimeData</a> * <i>data</i>, <a href="qt.html#DropAction-enum">Qt::DropAction</a> <i>action</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
202
<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>
 
203
<p>See also <a href="qlistwidget.html#supportedDropActions">supportedDropActions</a>().</p>
 
204
<h3 class="fn"><a name="editItem"></a>void QListWidget::editItem ( <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i> )</h3>
 
205
<p>Starts editing the <i>item</i> if it is editable.</p>
 
206
<h3 class="fn"><a name="findItems"></a><a href="qlist.html">QList</a>&lt;<a href="qlistwidgetitem.html">QListWidgetItem</a> *&gt; QListWidget::findItems ( const <a href="qstring.html">QString</a> &amp; <i>text</i>, <a href="qt.html#MatchFlag-enum">Qt::MatchFlags</a> <i>flags</i> ) const</h3>
 
207
<p>Finds items with the text that matches the string <i>text</i> using the given <i>flags</i>.</p>
 
208
<h3 class="fn"><a name="indexFromItem"></a><a href="qmodelindex.html">QModelIndex</a> QListWidget::indexFromItem ( <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i> ) const&nbsp;&nbsp;<tt> [protected]</tt></h3>
 
209
<p>Returns the <a href="qmodelindex.html">QModelIndex</a> assocated with the given <i>item</i>.</p>
 
210
<h3 class="fn"><a name="insertItem"></a>void QListWidget::insertItem ( int <i>row</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i> )</h3>
 
211
<p>Inserts the <i>item</i> at the position in the list given by <i>row</i>.</p>
 
212
<p>See also <a href="qlistwidget.html#addItem">addItem</a>().</p>
 
213
<h3 class="fn"><a name="insertItem-2"></a>void QListWidget::insertItem ( int <i>row</i>, const <a href="qstring.html">QString</a> &amp; <i>label</i> )</h3>
 
214
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
215
<p>Inserts an item with the text <i>label</i> in the list widget at the position given by <i>row</i>.</p>
 
216
<p>See also <a href="qlistwidget.html#addItem">addItem</a>().</p>
 
217
<h3 class="fn"><a name="insertItems"></a>void QListWidget::insertItems ( int <i>row</i>, const <a href="qstringlist.html">QStringList</a> &amp; <i>labels</i> )</h3>
 
218
<p>Inserts items from the list of <i>labels</i> into the list, starting at the given <i>row</i>.</p>
 
219
<p>See also <a href="qlistwidget.html#insertItem">insertItem</a>() and <a href="qlistwidget.html#addItem">addItem</a>().</p>
 
220
<h3 class="fn"><a name="isItemHidden"></a>bool QListWidget::isItemHidden ( const <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i> ) const</h3>
 
221
<p>Returns true if the <i>item</i> is explicitly hidden; otherwise returns false.</p>
 
222
<h3 class="fn"><a name="isItemSelected"></a>bool QListWidget::isItemSelected ( const <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i> ) const</h3>
 
223
<p>Returns true if <i>item</i> is selected and not hidden; otherwise returns false.</p>
 
224
<h3 class="fn"><a name="item"></a><a href="qlistwidgetitem.html">QListWidgetItem</a> * QListWidget::item ( int <i>row</i> ) const</h3>
 
225
<p>Returns the item that occupies the given <i>row</i> in the list.</p>
 
226
<p>See also <a href="qlistwidget.html#row">row</a>().</p>
 
227
<h3 class="fn"><a name="itemActivated"></a>void QListWidget::itemActivated ( <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
228
<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 <a href="winsystem.html#x11">X11</a> this is the <b>Return</b> key, on Mac OS X it is <b>Ctrl+0</b>).</p>
 
229
<h3 class="fn"><a name="itemAt"></a><a href="qlistwidgetitem.html">QListWidgetItem</a> * QListWidget::itemAt ( const <a href="qpoint.html">QPoint</a> &amp; <i>p</i> ) const</h3>
 
230
<p>Returns a pointer to the item at the coordinates <i>p</i>.</p>
 
231
<h3 class="fn"><a name="itemAt-2"></a><a href="qlistwidgetitem.html">QListWidgetItem</a> * QListWidget::itemAt ( int <i>x</i>, int <i>y</i> ) const</h3>
 
232
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
233
<p>Returns a pointer to the item at the coordinates (<i>x</i>, <i>y</i>).</p>
 
234
<h3 class="fn"><a name="itemChanged"></a>void QListWidget::itemChanged ( <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
235
<p>This signal is emitted whenever the data of <i>item</i> has changed.</p>
 
236
<h3 class="fn"><a name="itemClicked"></a>void QListWidget::itemClicked ( <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
237
<p>This signal is emitted when a mouse button is clicked. The <i>item</i> may be 0 if the mouse was not clicked on an item.</p>
 
238
<h3 class="fn"><a name="itemDoubleClicked"></a>void QListWidget::itemDoubleClicked ( <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
239
<p>This signal is emitted when a mouse button is double clicked. The <i>item</i> may be 0 if the mouse was not clicked on an item.</p>
 
240
<h3 class="fn"><a name="itemEntered"></a>void QListWidget::itemEntered ( <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
241
<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>
 
242
<h3 class="fn"><a name="itemFromIndex"></a><a href="qlistwidgetitem.html">QListWidgetItem</a> * QListWidget::itemFromIndex ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> ) const&nbsp;&nbsp;<tt> [protected]</tt></h3>
 
243
<p>Returns a pointer to the <a href="qlistwidgetitem.html">QListWidgetItem</a> assocated with the given <i>index</i>.</p>
 
244
<h3 class="fn"><a name="itemPressed"></a>void QListWidget::itemPressed ( <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
245
<p>This signal is emitted when a item has been pressed (mouse click and release). The <i>item</i> may be 0 if the mouse was not pressed on an item.</p>
 
246
<h3 class="fn"><a name="itemSelectionChanged"></a>void QListWidget::itemSelectionChanged ()&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
247
<p>This signal is emitted whenever the selection changes.</p>
 
248
<p>See also <a href="qlistwidget.html#selectedItems">selectedItems</a>() and <a href="qlistwidget.html#isItemSelected">isItemSelected</a>().</p>
 
249
<h3 class="fn"><a name="items"></a><a href="qlist.html">QList</a>&lt;<a href="qlistwidgetitem.html">QListWidgetItem</a> *&gt; QListWidget::items ( const <a href="qmimedata.html">QMimeData</a> * <i>data</i> ) const&nbsp;&nbsp;<tt> [protected]</tt></h3>
 
250
<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="qtreewidget.html">QTreeWidget</a> in the same process, the list is empty.</p>
 
251
<h3 class="fn"><a name="mimeData"></a><a href="qmimedata.html">QMimeData</a> * QListWidget::mimeData ( const <a href="qlist.html">QList</a>&lt;<a href="qlistwidgetitem.html">QListWidgetItem</a> *&gt; <i>items</i> ) const&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
252
<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>
 
253
<p>If the list of items is empty, 0 is returned rather than a serialized empty list.</p>
 
254
<h3 class="fn"><a name="mimeTypes"></a><a href="qstringlist.html">QStringList</a> QListWidget::mimeTypes () const&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
255
<p>Returns a list of MIME types that can be used to describe a list of listwidget items.</p>
 
256
<p>See also <a href="qlistwidget.html#mimeData">mimeData</a>().</p>
 
257
<h3 class="fn"><a name="openPersistentEditor"></a>void QListWidget::openPersistentEditor ( <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i> )</h3>
 
258
<p>Opens an editor for the given <i>item</i>. The editor remains open after editing.</p>
 
259
<p>See also <a href="qlistwidget.html#closePersistentEditor">closePersistentEditor</a>().</p>
 
260
<h3 class="fn"><a name="row"></a>int QListWidget::row ( const <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i> ) const</h3>
 
261
<p>Returns the row containing the given <i>item</i>.</p>
 
262
<p>See also <a href="qlistwidget.html#item">item</a>().</p>
 
263
<h3 class="fn"><a name="scrollToItem"></a>void QListWidget::scrollToItem ( const <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i>, <a href="qabstractitemview.html#ScrollHint-enum">ScrollHint</a> <i>hint</i> = EnsureVisible )&nbsp;&nbsp;<tt> [slot]</tt></h3>
 
264
<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>
 
265
<h3 class="fn"><a name="selectedItems"></a><a href="qlist.html">QList</a>&lt;<a href="qlistwidgetitem.html">QListWidgetItem</a> *&gt; QListWidget::selectedItems () const</h3>
 
266
<p>Returns a list of all selected items in the list widget.</p>
 
267
<h3 class="fn"><a name="setCurrentItem"></a>void QListWidget::setCurrentItem ( <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i> )</h3>
 
268
<p>Sets the current item to <i>item</i>.</p>
 
269
<h3 class="fn"><a name="setItemHidden"></a>void QListWidget::setItemHidden ( const <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i>, bool <i>hide</i> )</h3>
 
270
<p>If <i>hide</i> is true, the <i>item</i> will be hidden; otherwise it will be shown.</p>
 
271
<h3 class="fn"><a name="setItemSelected"></a>void QListWidget::setItemSelected ( const <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i>, bool <i>select</i> )</h3>
 
272
<p>Selects or deselects the given <i>item</i> depending on whether <i>select</i> is true of false.</p>
 
273
<h3 class="fn"><a name="sortItems"></a>void QListWidget::sortItems ( <a href="qt.html#SortOrder-enum">Qt::SortOrder</a> <i>order</i> = Qt::AscendingOrder )</h3>
 
274
<p>Sorts all the items in the list widget according to the specified <i>order</i>.</p>
 
275
<h3 class="fn"><a name="supportedDropActions"></a><a href="qt.html#DropAction-enum">Qt::DropActions</a> QListWidget::supportedDropActions () const&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
276
<p>Returns the drop actions supported by this view.</p>
 
277
<p>See also <a href="qt.html#DropAction-enum">Qt::DropActions</a>.</p>
 
278
<h3 class="fn"><a name="takeItem"></a><a href="qlistwidgetitem.html">QListWidgetItem</a> * QListWidget::takeItem ( int <i>row</i> )</h3>
 
279
<p>Removes and returns the item from the given <i>row</i> in the list widget, otherwise return 0;</p>
 
280
<p>See also <a href="qlistwidget.html#insertItem">insertItem</a>() and <a href="qlistwidget.html#addItem">addItem</a>().</p>
 
281
<h3 class="fn"><a name="visualItemRect"></a><a href="qrect.html">QRect</a> QListWidget::visualItemRect ( const <a href="qlistwidgetitem.html">QListWidgetItem</a> * <i>item</i> ) const</h3>
 
282
<p>Returns the rectangle on the viewport occupied by the item at <i>item</i>.</p>
 
283
<p /><address><hr /><div align="center">
 
284
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
285
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
286
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
287
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
288
</tr></table></div></address></body>
 
289
</html>