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

« back to all changes in this revision

Viewing changes to doc/html/qlistview.html

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2008-08-01 11:30:30 UTC
  • mto: (15.1.1 lenny) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 55.
  • Revision ID: james.westby@ubuntu.com-20080801113030-c33y1z0l21t6cj5r
Tags: upstream-4.4.1
ImportĀ upstreamĀ versionĀ 4.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
<!DOCTYPE html
3
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
 
<!-- /fasttmp/mkdist-qt-4.4.0-1209388211/qt-x11-opensource-src-4.4.0/src/gui/itemviews/qlistview.cpp -->
 
5
<!-- /fasttmp/mkdist-qt-4.4.1-1217326953/qt-all-opensource-src-4.4.1/src/gui/itemviews/qlistview.cpp -->
6
6
<head>
7
7
  <title>Qt 4.4: QListView Class Reference</title>
8
8
  <link href="classic.css" rel="stylesheet" type="text/css" />
9
9
</head>
10
10
<body>
 
11
<a name="//apple_ref/cpp/cl//QListView" />
11
12
<table border="0" cellpadding="0" cellspacing="0" width="100%">
12
13
<tr>
13
14
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
98
99
<li><div class="fn"/>13 public functions inherited from <a href="qframe.html#public-functions">QFrame</a></li>
99
100
<li><div class="fn"/>206 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
100
101
<li><div class="fn"/>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
101
 
<li><div class="fn"/>14 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
 
102
<li><div class="fn"/>12 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
102
103
</ul>
103
104
<a name="signals"></a>
104
105
<h3>Signals</h3>
157
158
<p>See also <a href="model-view-view.html">View Classes</a>, <a href="qtreeview.html">QTreeView</a>, <a href="qtableview.html">QTableView</a>, and <a href="qlistwidget.html">QListWidget</a>.</p>
158
159
<hr />
159
160
<h2>Member Type Documentation</h2>
 
161
<a name="//apple_ref/cpp/tag/QListView/Flow" />
 
162
<a name="//apple_ref/cpp/econst/QListView/LeftToRight" />
 
163
<a name="//apple_ref/cpp/econst/QListView/TopToBottom" />
160
164
<h3 class="fn"><a name="Flow-enum"></a>enum QListView::Flow</h3>
161
165
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
162
166
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
163
167
<tr><td valign="top"><tt>QListView::LeftToRight</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">The items are laid out in the view from the left to the right.</td></tr>
164
168
<tr><td valign="top"><tt>QListView::TopToBottom</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The items are laid out in the view from the top to the bottom.</td></tr>
165
169
</table></p>
 
170
<a name="//apple_ref/cpp/tag/QListView/LayoutMode" />
 
171
<a name="//apple_ref/cpp/econst/QListView/SinglePass" />
 
172
<a name="//apple_ref/cpp/econst/QListView/Batched" />
166
173
<h3 class="fn"><a name="LayoutMode-enum"></a>enum QListView::LayoutMode</h3>
167
174
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
168
175
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
170
177
<tr><td valign="top"><tt>QListView::Batched</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The items are laid out in batches of <a href="qlistview.html#batchSize-prop">batchSize</a> items.</td></tr>
171
178
</table></p>
172
179
<p>See also <a href="qlistview.html#batchSize-prop">batchSize</a>.</p>
 
180
<a name="//apple_ref/cpp/tag/QListView/Movement" />
 
181
<a name="//apple_ref/cpp/econst/QListView/Static" />
 
182
<a name="//apple_ref/cpp/econst/QListView/Free" />
 
183
<a name="//apple_ref/cpp/econst/QListView/Snap" />
173
184
<h3 class="fn"><a name="Movement-enum"></a>enum QListView::Movement</h3>
174
185
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
175
186
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
177
188
<tr><td valign="top"><tt>QListView::Free</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The items can be moved freely by the user.</td></tr>
178
189
<tr><td valign="top"><tt>QListView::Snap</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">The items snap to the specified grid when moved; see <a href="qlistview.html#gridSize-prop">setGridSize</a>().</td></tr>
179
190
</table></p>
 
191
<a name="//apple_ref/cpp/tag/QListView/ResizeMode" />
 
192
<a name="//apple_ref/cpp/econst/QListView/Fixed" />
 
193
<a name="//apple_ref/cpp/econst/QListView/Adjust" />
180
194
<h3 class="fn"><a name="ResizeMode-enum"></a>enum QListView::ResizeMode</h3>
181
195
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
182
196
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
183
197
<tr><td valign="top"><tt>QListView::Fixed</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">The items will only be laid out the first time the view is shown.</td></tr>
184
198
<tr><td valign="top"><tt>QListView::Adjust</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The items will be laid out every time the view is resized.</td></tr>
185
199
</table></p>
 
200
<a name="//apple_ref/cpp/tag/QListView/ViewMode" />
 
201
<a name="//apple_ref/cpp/econst/QListView/ListMode" />
 
202
<a name="//apple_ref/cpp/econst/QListView/IconMode" />
186
203
<h3 class="fn"><a name="ViewMode-enum"></a>enum QListView::ViewMode</h3>
187
204
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
188
205
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
191
208
</table></p>
192
209
<hr />
193
210
<h2>Property Documentation</h2>
 
211
<a name="//apple_ref/cpp/instm/QListView/batchSize" />
 
212
<a name="//apple_ref/cpp/instm/QListView/setBatchSize" />
194
213
<h3 class="fn"><a name="batchSize-prop"></a>batchSize : int</h3>
195
214
<p>This property holds the number of items laid out in each batch if layoutMode is set to Batched.</p>
196
215
<p>The default value is 100.</p>
200
219
<li><div class="fn"/><b>int batchSize () const</b></li>
201
220
<li><div class="fn"/><b>void setBatchSize ( int <i>batchSize</i> )</b></li>
202
221
</ul>
 
222
<a name="//apple_ref/cpp/instm/QListView/flow" />
 
223
<a name="//apple_ref/cpp/instm/QListView/setFlow" />
203
224
<h3 class="fn"><a name="flow-prop"></a>flow : <a href="qlistview.html#Flow-enum">Flow</a></h3>
204
225
<p>This property holds which direction the items layout should flow.</p>
205
226
<p>If this property is <a href="qlistview.html#Flow-enum">LeftToRight</a>, the items will be laid out left to right. If the <a href="qlistview.html#isWrapping-prop">isWrapping</a> property is true, the layout will wrap when it reaches the right side of the visible area. If this property is <a href="qlistview.html#Flow-enum">TopToBottom</a>, the items will be laid out from the top of the visible area, wrapping when it reaches the bottom.</p>
210
231
<li><div class="fn"/><b>void setFlow ( Flow <i>flow</i> )</b></li>
211
232
</ul>
212
233
<p>See also <a href="qlistview.html#viewMode-prop">viewMode</a>.</p>
 
234
<a name="//apple_ref/cpp/instm/QListView/gridSize" />
 
235
<a name="//apple_ref/cpp/instm/QListView/setGridSize" />
213
236
<h3 class="fn"><a name="gridSize-prop"></a>gridSize : <a href="qsize.html">QSize</a></h3>
214
237
<p>This property holds the size of the layout grid.</p>
215
238
<p>This property is the size of the grid in which the items are laid out. The default is an empty size which means that there is no grid and the layout is not done in a grid. Setting this property to a non-empty size switches on the grid layout. (When a grid layout is in force the <a href="qlistview.html#spacing-prop">spacing</a> property is ignored.)</p>
220
243
<li><div class="fn"/><b>void setGridSize ( const QSize &amp; <i>size</i> )</b></li>
221
244
</ul>
222
245
<p>See also <a href="qlistview.html#viewMode-prop">viewMode</a>.</p>
 
246
<a name="//apple_ref/cpp/instm/QListView/isWrapping" />
 
247
<a name="//apple_ref/cpp/instm/QListView/setWrapping" />
223
248
<h3 class="fn"><a name="isWrapping-prop"></a>isWrapping : bool</h3>
224
249
<p>This property holds whether the items layout should wrap.</p>
225
250
<p>This property holds whether the layout should wrap when there is no more space in the visible area. The point at which the layout wraps depends on the <a href="qlistview.html#flow-prop">flow</a> property.</p>
230
255
<li><div class="fn"/><b>void setWrapping ( bool <i>enable</i> )</b></li>
231
256
</ul>
232
257
<p>See also <a href="qlistview.html#viewMode-prop">viewMode</a>.</p>
 
258
<a name="//apple_ref/cpp/instm/QListView/layoutMode" />
 
259
<a name="//apple_ref/cpp/instm/QListView/setLayoutMode" />
233
260
<h3 class="fn"><a name="layoutMode-prop"></a>layoutMode : <a href="qlistview.html#LayoutMode-enum">LayoutMode</a></h3>
234
 
<p>This property holds whether the layout of items should happen immediately or be delayed.</p>
 
261
<p>This property determines whether the layout of items should happen immediately or be delayed.</p>
235
262
<p>This property holds the layout mode for the items. When the mode is <a href="qlistview.html#LayoutMode-enum">SinglePass</a> (the default), the items are laid out all in one go. When the mode is <a href="qlistview.html#LayoutMode-enum">Batched</a>, the items are laid out in batches of <a href="qlistview.html#batchSize-prop">batchSize</a> items, while processing events. This makes it possible to instantly view and interact with the visible items while the rest are being laid out.</p>
236
263
<p>Access functions:</p>
237
264
<ul>
239
266
<li><div class="fn"/><b>void setLayoutMode ( LayoutMode <i>mode</i> )</b></li>
240
267
</ul>
241
268
<p>See also <a href="qlistview.html#viewMode-prop">viewMode</a>.</p>
 
269
<a name="//apple_ref/cpp/instm/QListView/modelColumn" />
 
270
<a name="//apple_ref/cpp/instm/QListView/setModelColumn" />
242
271
<h3 class="fn"><a name="modelColumn-prop"></a>modelColumn : int</h3>
243
272
<p>This property holds the column in the model that is visible.</p>
244
273
<p>Access functions:</p>
246
275
<li><div class="fn"/><b>int modelColumn () const</b></li>
247
276
<li><div class="fn"/><b>void setModelColumn ( int <i>column</i> )</b></li>
248
277
</ul>
 
278
<a name="//apple_ref/cpp/instm/QListView/movement" />
 
279
<a name="//apple_ref/cpp/instm/QListView/setMovement" />
249
280
<h3 class="fn"><a name="movement-prop"></a>movement : <a href="qlistview.html#Movement-enum">Movement</a></h3>
250
281
<p>This property holds whether the items can be moved freely, are snapped to a grid, or cannot be moved at all.</p>
251
282
<p>This property determines how the user can move the items in the view. <a href="qlistview.html#Movement-enum">Static</a> means that the items can't be moved the user. <a href="qlistview.html#Movement-enum">Free</a> means that the user can drag and drop the items to any position in the view. <a href="qlistview.html#Movement-enum">Snap</a> means that the user can drag and drop the items, but only to the positions in a notional grid signified by the <a href="qlistview.html#gridSize-prop">gridSize</a> property.</p>
256
287
<li><div class="fn"/><b>void setMovement ( Movement <i>movement</i> )</b></li>
257
288
</ul>
258
289
<p>See also <a href="qlistview.html#gridSize-prop">gridSize</a> and <a href="qlistview.html#viewMode-prop">viewMode</a>.</p>
 
290
<a name="//apple_ref/cpp/instm/QListView/resizeMode" />
 
291
<a name="//apple_ref/cpp/instm/QListView/setResizeMode" />
259
292
<h3 class="fn"><a name="resizeMode-prop"></a>resizeMode : <a href="qlistview.html#ResizeMode-enum">ResizeMode</a></h3>
260
293
<p>This property holds whether the items are laid out again when the view is resized.</p>
261
294
<p>If this property is <a href="qlistview.html#ResizeMode-enum">Adjust</a>, the items will be laid out again when the view is resized. If the value is <a href="qlistview.html#ResizeMode-enum">Fixed</a>, the items will not be laid out when the view is resized.</p>
265
298
<li><div class="fn"/><b>void setResizeMode ( ResizeMode <i>mode</i> )</b></li>
266
299
</ul>
267
300
<p>See also <a href="qlistview.html#viewMode-prop">viewMode</a>.</p>
 
301
<a name="//apple_ref/cpp/instm/QListView/isSelectionRectVisible" />
 
302
<a name="//apple_ref/cpp/instm/QListView/setSelectionRectVisible" />
268
303
<h3 class="fn"><a name="selectionRectVisible-prop"></a>selectionRectVisible : bool</h3>
269
304
<p>This property holds if the selection rectangle should be visible.</p>
270
305
<p>If this property is true then the selection rectangle is visible; otherwise it will be hidden. Note that the selection rectangle will only be visible if the selection mode is in a mode where more than one item can be selected, i.e&#x2e; it will not draw a selection rectangle if the selection mode is <a href="qabstractitemview.html#SelectionMode-enum">QAbstractItemView::SingleSelection</a>.</p>
274
309
<li><div class="fn"/><b>bool isSelectionRectVisible () const</b></li>
275
310
<li><div class="fn"/><b>void setSelectionRectVisible ( bool <i>show</i> )</b></li>
276
311
</ul>
 
312
<a name="//apple_ref/cpp/instm/QListView/spacing" />
 
313
<a name="//apple_ref/cpp/instm/QListView/setSpacing" />
277
314
<h3 class="fn"><a name="spacing-prop"></a>spacing : int</h3>
278
315
<p>This property holds the space between items in the layout.</p>
279
316
<p>This property is the size of the empty space that is padded around an item in the layout.</p>
284
321
<li><div class="fn"/><b>void setSpacing ( int <i>space</i> )</b></li>
285
322
</ul>
286
323
<p>See also <a href="qlistview.html#viewMode-prop">viewMode</a>.</p>
 
324
<a name="//apple_ref/cpp/instm/QListView/uniformItemSizes" />
 
325
<a name="//apple_ref/cpp/instm/QListView/setUniformItemSizes" />
287
326
<h3 class="fn"><a name="uniformItemSizes-prop"></a>uniformItemSizes : bool</h3>
288
327
<p>This property holds whether all items in the listview have the same size.</p>
289
328
<p>This property should only be set to true if it is guaranteed that all items in the view have the same size. This enables the view to do some optimizations.</p>
293
332
<li><div class="fn"/><b>bool uniformItemSizes () const</b></li>
294
333
<li><div class="fn"/><b>void setUniformItemSizes ( bool <i>enable</i> )</b></li>
295
334
</ul>
 
335
<a name="//apple_ref/cpp/instm/QListView/viewMode" />
 
336
<a name="//apple_ref/cpp/instm/QListView/setViewMode" />
296
337
<h3 class="fn"><a name="viewMode-prop"></a>viewMode : <a href="qlistview.html#ViewMode-enum">ViewMode</a></h3>
297
338
<p>This property holds the view mode of the QListView.</p>
298
339
<p>This property will change the other unset properties to conform with the set view mode. <a href="qlistview.html">QListView</a>-specific properties that have already been set will not be changed, unless <a href="qlistview.html#clearPropertyFlags">clearPropertyFlags</a>() has been called.</p>
303
344
<li><div class="fn"/><b>void setViewMode ( ViewMode <i>mode</i> )</b></li>
304
345
</ul>
305
346
<p>See also <a href="qlistview.html#isWrapping-prop">isWrapping</a>, <a href="qlistview.html#spacing-prop">spacing</a>, <a href="qlistview.html#gridSize-prop">gridSize</a>, <a href="qlistview.html#flow-prop">flow</a>, <a href="qlistview.html#movement-prop">movement</a>, and <a href="qlistview.html#resizeMode-prop">resizeMode</a>.</p>
 
347
<a name="//apple_ref/cpp/instm/QListView/wordWrap" />
 
348
<a name="//apple_ref/cpp/instm/QListView/setWordWrap" />
306
349
<h3 class="fn"><a name="wordWrap-prop"></a>wordWrap : bool</h3>
307
350
<p>This property holds the item text word-wrapping policy.</p>
308
351
<p>If this property is true then the item text is wrapped where necessary at word-breaks; otherwise it is not wrapped at all. This property is false by default.</p>
 
352
<p>Please note that even if wrapping is enabled, the cell will not be expanded to make room for the text. It will print ellipsis for text that cannot be shown, according to the view's <a href="qabstractitemview.html#textElideMode-prop">textElideMode</a>.</p>
309
353
<p>This property was introduced in Qt 4.2.</p>
310
354
<p>Access functions:</p>
311
355
<ul>
314
358
</ul>
315
359
<hr />
316
360
<h2>Member Function Documentation</h2>
 
361
<a name="//apple_ref/cpp/instm/QListView/QListView" />
317
362
<h3 class="fn"><a name="QListView"></a>QListView::QListView ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
318
363
<p>Creates a new <a href="qlistview.html">QListView</a> with the given <i>parent</i> to view a model. Use <a href="qabstractitemview.html#setModel">setModel</a>() to set the model.</p>
 
364
<a name="//apple_ref/cpp/instm/QListView/~QListView" />
319
365
<h3 class="fn"><a name="dtor.QListView"></a>QListView::~QListView ()</h3>
320
366
<p>Destroys the view.</p>
 
367
<a name="//apple_ref/cpp/instm/QListView/clearPropertyFlags" />
321
368
<h3 class="fn"><a name="clearPropertyFlags"></a>void QListView::clearPropertyFlags ()</h3>
322
369
<p>Clears the <a href="qlistview.html">QListView</a>-specific property flags. See <a href="qlistview.html#viewMode-prop">viewMode</a>.</p>
323
370
<p>Properties inherited from <a href="qabstractitemview.html">QAbstractItemView</a> are not covered by the property flags. Specifically, <a href="qabstractitemview.html#dragEnabled-prop">dragEnabled</a> and <a href="qwidget.html#acceptDrops-prop">acceptDrops</a> are computed by <a href="qlistview.html">QListView</a> when calling <a href="qlistview.html#movement-prop">setMovement</a>() or <a href="qlistview.html#viewMode-prop">setViewMode</a>().</p>
 
371
<a name="//apple_ref/cpp/instm/QListView/indexesMoved" />
324
372
<h3 class="fn"><a name="indexesMoved"></a>void QListView::indexesMoved ( const <a href="qmodelindex.html#QModelIndexList-typedef">QModelIndexList</a> &amp; <i>indexes</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
325
373
<p>This signal is emitted when the specified <i>indexes</i> are moved in the view.</p>
326
374
<p>This function was introduced in Qt 4.2.</p>
 
375
<a name="//apple_ref/cpp/instm/QListView/isRowHidden" />
327
376
<h3 class="fn"><a name="isRowHidden"></a>bool QListView::isRowHidden ( int <i>row</i> ) const</h3>
328
377
<p>Returns true if the <i>row</i> is hidden; otherwise returns false.</p>
 
378
<a name="//apple_ref/cpp/instm/QListView/rectForIndex" />
329
379
<h3 class="fn"><a name="rectForIndex"></a><a href="qrect.html">QRect</a> QListView::rectForIndex ( const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> ) const&nbsp;&nbsp;<tt> [protected]</tt></h3>
330
380
<p>Returns the rectangle of the item at position <i>index</i> in the model. The rectangle is in contents coordinates.</p>
331
381
<p>See also <a href="qabstractitemview.html#visualRect">visualRect</a>().</p>
 
382
<a name="//apple_ref/cpp/instm/QListView/setPositionForIndex" />
332
383
<h3 class="fn"><a name="setPositionForIndex"></a>void QListView::setPositionForIndex ( const <a href="qpoint.html">QPoint</a> &amp; <i>position</i>, const <a href="qmodelindex.html">QModelIndex</a> &amp; <i>index</i> )&nbsp;&nbsp;<tt> [protected]</tt></h3>
333
384
<p>Sets the contents position of the item at <i>index</i> in the model to the given <i>position</i>. If the list view's movement mode is Static, this function will have no effect.</p>
334
385
<p>This function was introduced in Qt 4.1.</p>
 
386
<a name="//apple_ref/cpp/instm/QListView/setRowHidden" />
335
387
<h3 class="fn"><a name="setRowHidden"></a>void QListView::setRowHidden ( int <i>row</i>, bool <i>hide</i> )</h3>
336
388
<p>If <i>hide</i> is true, the given <i>row</i> will be hidden; otherwise the <i>row</i> will be shown.</p>
337
389
<p>See also <a href="qlistview.html#isRowHidden">isRowHidden</a>().</p>
339
391
<table width="100%" cellspacing="0" border="0"><tr class="address">
340
392
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
341
393
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
342
 
<td width="30%" align="right"><div align="right">Qt 4.4.0</div></td>
 
394
<td width="30%" align="right"><div align="right">Qt 4.4.1</div></td>
343
395
</tr></table></div></address></body>
344
396
</html>