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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/iconview/qiconview.cpp:800 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QIconViewItem Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td 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="mainclasses.html">
<font color="#004faf">Main Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped Classes</font></a>
| <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QIconViewItem Class Reference<br><small>[<a href="iconview.html">iconview module</a>]</small></h1>
<p>The QIconViewItem class provides a single item in a QIconView.
<a href="#details">More...</a>
<p><tt>#include <<a href="qiconview-h.html">qiconview.h</a>></tt>
<p>Inherits <a href="qt.html">Qt</a>.
<p><a href="qiconviewitem-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#QIconViewItem"><b>QIconViewItem</b></a> ( QIconView * parent )</li>
<li class=fn><a href="#QIconViewItem-2"><b>QIconViewItem</b></a> ( QIconView * parent, QIconViewItem * after )</li>
<li class=fn><a href="#QIconViewItem-3"><b>QIconViewItem</b></a> ( QIconView * parent, const QString & text )</li>
<li class=fn><a href="#QIconViewItem-4"><b>QIconViewItem</b></a> ( QIconView * parent, QIconViewItem * after, const QString & text )</li>
<li class=fn><a href="#QIconViewItem-5"><b>QIconViewItem</b></a> ( QIconView * parent, const QString & text, const QPixmap & icon )</li>
<li class=fn><a href="#QIconViewItem-6"><b>QIconViewItem</b></a> ( QIconView * parent, QIconViewItem * after, const QString & text, const QPixmap & icon )</li>
<li class=fn><a href="#QIconViewItem-7"><b>QIconViewItem</b></a> ( QIconView * parent, const QString & text, const QPicture & picture )</li>
<li class=fn><a href="#QIconViewItem-8"><b>QIconViewItem</b></a> ( QIconView * parent, QIconViewItem * after, const QString & text, const QPicture & picture )</li>
<li class=fn>virtual <a href="#~QIconViewItem"><b>~QIconViewItem</b></a> ()</li>
<li class=fn>virtual void <a href="#setRenameEnabled"><b>setRenameEnabled</b></a> ( bool allow )</li>
<li class=fn>virtual void <a href="#setDragEnabled"><b>setDragEnabled</b></a> ( bool allow )</li>
<li class=fn>virtual void <a href="#setDropEnabled"><b>setDropEnabled</b></a> ( bool allow )</li>
<li class=fn>virtual QString <a href="#text"><b>text</b></a> () const</li>
<li class=fn>virtual QPixmap * <a href="#pixmap"><b>pixmap</b></a> () const</li>
<li class=fn>virtual QPicture * <a href="#picture"><b>picture</b></a> () const</li>
<li class=fn>virtual QString <a href="#key"><b>key</b></a> () const</li>
<li class=fn>bool <a href="#renameEnabled"><b>renameEnabled</b></a> () const</li>
<li class=fn>bool <a href="#dragEnabled"><b>dragEnabled</b></a> () const</li>
<li class=fn>bool <a href="#dropEnabled"><b>dropEnabled</b></a> () const</li>
<li class=fn>QIconView * <a href="#iconView"><b>iconView</b></a> () const</li>
<li class=fn>QIconViewItem * <a href="#prevItem"><b>prevItem</b></a> () const</li>
<li class=fn>QIconViewItem * <a href="#nextItem"><b>nextItem</b></a> () const</li>
<li class=fn>int <a href="#index"><b>index</b></a> () const</li>
<li class=fn>virtual void <a href="#setSelected"><b>setSelected</b></a> ( bool s, bool cb )</li>
<li class=fn>virtual void <a href="#setSelected-2"><b>setSelected</b></a> ( bool s )</li>
<li class=fn>virtual void <a href="#setSelectable"><b>setSelectable</b></a> ( bool enable )</li>
<li class=fn>bool <a href="#isSelected"><b>isSelected</b></a> () const</li>
<li class=fn>bool <a href="#isSelectable"><b>isSelectable</b></a> () const</li>
<li class=fn>virtual void <a href="#repaint"><b>repaint</b></a> ()</li>
<li class=fn>virtual bool <a href="#move"><b>move</b></a> ( int x, int y )</li>
<li class=fn>virtual void <a href="#moveBy"><b>moveBy</b></a> ( int dx, int dy )</li>
<li class=fn>virtual bool <a href="#move-2"><b>move</b></a> ( const QPoint & pnt )</li>
<li class=fn>virtual void <a href="#moveBy-2"><b>moveBy</b></a> ( const QPoint & pnt )</li>
<li class=fn>QRect <a href="#rect"><b>rect</b></a> () const</li>
<li class=fn>int <a href="#x"><b>x</b></a> () const</li>
<li class=fn>int <a href="#y"><b>y</b></a> () const</li>
<li class=fn>int <a href="#width"><b>width</b></a> () const</li>
<li class=fn>int <a href="#height"><b>height</b></a> () const</li>
<li class=fn>QSize <a href="#size"><b>size</b></a> () const</li>
<li class=fn>QPoint <a href="#pos"><b>pos</b></a> () const</li>
<li class=fn>QRect <a href="#textRect"><b>textRect</b></a> ( bool relative = TRUE ) const</li>
<li class=fn>QRect <a href="#pixmapRect"><b>pixmapRect</b></a> ( bool relative = TRUE ) const</li>
<li class=fn>bool <a href="#contains"><b>contains</b></a> ( const QPoint & pnt ) const</li>
<li class=fn>bool <a href="#intersects"><b>intersects</b></a> ( const QRect & r ) const</li>
<li class=fn>virtual bool <a href="#acceptDrop"><b>acceptDrop</b></a> ( const QMimeSource * mime ) const</li>
<li class=fn>void <a href="#rename"><b>rename</b></a> ()</li>
<li class=fn>virtual int <a href="#compare"><b>compare</b></a> ( QIconViewItem * i ) const</li>
<li class=fn>virtual void <a href="#setText"><b>setText</b></a> ( const QString & text )</li>
<li class=fn>virtual void <a href="#setPixmap"><b>setPixmap</b></a> ( const QPixmap & icon )</li>
<li class=fn>virtual void <a href="#setPicture"><b>setPicture</b></a> ( const QPicture & icon )</li>
<li class=fn>virtual void <a href="#setText-2"><b>setText</b></a> ( const QString & text, bool recalc, bool redraw = TRUE )</li>
<li class=fn>virtual void <a href="#setPixmap-2"><b>setPixmap</b></a> ( const QPixmap & icon, bool recalc, bool redraw = TRUE )</li>
<li class=fn>virtual void <a href="#setKey"><b>setKey</b></a> ( const QString & k )</li>
<li class=fn>virtual int <a href="#rtti"><b>rtti</b></a> () const</li>
</ul>
<h2>Protected Members</h2>
<ul>
<li class=fn>virtual void <a href="#removeRenameBox"><b>removeRenameBox</b></a> ()</li>
<li class=fn>virtual void <a href="#calcRect"><b>calcRect</b></a> ( const QString & text_ = QString::null )</li>
<li class=fn>virtual void <a href="#paintItem"><b>paintItem</b></a> ( QPainter * p, const QColorGroup & cg )</li>
<li class=fn>virtual void <a href="#paintFocus"><b>paintFocus</b></a> ( QPainter * p, const QColorGroup & cg )</li>
<li class=fn>virtual void <a href="#dropped"><b>dropped</b></a> ( QDropEvent * e, const QValueList<QIconDragItem> & lst )</li>
<li class=fn>virtual void <a href="#dragEntered"><b>dragEntered</b></a> ()</li>
<li class=fn>virtual void <a href="#dragLeft"><b>dragLeft</b></a> ()</li>
<li class=fn>void <a href="#setItemRect"><b>setItemRect</b></a> ( const QRect & r )</li>
<li class=fn>void <a href="#setTextRect"><b>setTextRect</b></a> ( const QRect & r )</li>
<li class=fn>void <a href="#setPixmapRect"><b>setPixmapRect</b></a> ( const QRect & r )</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>
The QIconViewItem class provides a single item in a <a href="qiconview.html">QIconView</a>.
<p>
<p> A QIconViewItem contains an icon, a string and optionally a sort
key, and can display itself in a QIconView.
The class is designed to be very similar to <a href="qlistview.html">QListView</a> and <a href="qlistbox.html">QListBox</a>
in use, both via instantiation and subclassing.
<p> The simplest way to create a QIconViewItem and insert it into a
QIconView is to construct the item passing the constructor a
pointer to the icon view, a string and an icon:
<p> <pre>
(void) new QIconViewItem(
iconView, // A pointer to a QIconView
"This is the text of the item",
aPixmap );
</pre>
<p> By default the text of an icon view item may not be edited by the
user but calling <a href="#setRenameEnabled">setRenameEnabled</a>(TRUE) will allow the user to
perform in-place editing of the item's text.
<p> When the icon view is deleted all items in it are deleted
automatically.
<p> The <a href="qiconview.html#firstItem">QIconView::firstItem</a>() and <a href="#nextItem">QIconViewItem::nextItem</a>() functions
provide a means of iterating over all the items in a QIconView:
<p> <pre>
QIconViewItem *item;
for ( item = iconView->firstItem(); item; item = item-><a href="#nextItem">nextItem</a>() )
do_something_with( item );
</pre>
<p> The item's icon view is available from <a href="#iconView">iconView</a>(), and its
position in the icon view from <a href="#index">index</a>().
<p> The item's selection status is available from <a href="#isSelected">isSelected</a>() and is
set and controlled by <a href="#setSelected">setSelected</a>() and <a href="#isSelectable">isSelectable</a>().
<p> The text and icon can be set with <a href="#setText">setText</a>() and <a href="#setPixmap">setPixmap</a>() and
retrieved with <a href="#text">text</a>() and <a href="#pixmap">pixmap</a>(). The item's sort key defaults
to text() but may be set with <a href="#setKey">setKey</a>() and retrieved with <a href="#key">key</a>().
The comparison function, <a href="#compare">compare</a>() uses key().
<p> Items may be repositioned with <a href="#move">move</a>() and <a href="#moveBy">moveBy</a>(). An item's
geometry is available from <a href="#rect">rect</a>(), <a href="#x">x</a>(), <a href="#y">y</a>(), <a href="#width">width</a>(), <a href="#height">height</a>(),
<a href="#size">size</a>(), <a href="#pos">pos</a>(), <a href="#textRect">textRect</a>() and <a href="#pixmapRect">pixmapRect</a>(). You can also test
against the position of a point with <a href="#contains">contains</a>() and <a href="#intersects">intersects</a>().
<p> To remove an item from an icon view, just delete the item. The
QIconViewItem destructor removes it cleanly from its icon view.
<p> Because the icon view is designed to use drag-and-drop, the icon
view item also has functions for drag-and-drop which may be
reimplemented.
<p> <a name="pixmap-size-limit"></a>
<b>Note:</b> Pixmaps with individual dimensions larger than 300 pixels may
not be displayed properly, depending on the <a href="qiconview.html#Arrangement-enum">arrangement in use</a>. For example, pixmaps wider than 300 pixels
will not be arranged correctly if the icon view uses a
<a href="qiconview.html#Arrangement-enum">QIconView::TopToBottom</a> arrangement, and pixmaps taller than 300 pixels
will not be arranged correctly if the icon view uses a
<a href="qiconview.html#Arrangement-enum">QIconView::LeftToRight</a> arrangement.
<p>See also <a href="advanced.html">Advanced Widgets</a>.
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QIconViewItem"></a>QIconViewItem::QIconViewItem ( <a href="qiconview.html">QIconView</a> * parent )
</h3>
Constructs a QIconViewItem and inserts it into icon view <em>parent</em>
with no text and a default icon.
<h3 class=fn><a name="QIconViewItem-2"></a>QIconViewItem::QIconViewItem ( <a href="qiconview.html">QIconView</a> * parent, <a href="qiconviewitem.html">QIconViewItem</a> * after )
</h3>
Constructs a QIconViewItem and inserts it into the icon view <em>parent</em> with no text and a default icon, after the icon view item
<em>after</em>.
<h3 class=fn><a name="QIconViewItem-3"></a>QIconViewItem::QIconViewItem ( <a href="qiconview.html">QIconView</a> * parent, const <a href="qstring.html">QString</a> & text )
</h3>
Constructs an icon view item and inserts it into the icon view <em>parent</em> using <em>text</em> as the text and a default icon.
<h3 class=fn><a name="QIconViewItem-4"></a>QIconViewItem::QIconViewItem ( <a href="qiconview.html">QIconView</a> * parent, <a href="qiconviewitem.html">QIconViewItem</a> * after, const <a href="qstring.html">QString</a> & text )
</h3>
Constructs an icon view item and inserts it into the icon view <em>parent</em> using <em>text</em> as the text and a default icon, after the
icon view item <em>after</em>.
<h3 class=fn><a name="QIconViewItem-5"></a>QIconViewItem::QIconViewItem ( <a href="qiconview.html">QIconView</a> * parent, const <a href="qstring.html">QString</a> & text, const <a href="qpixmap.html">QPixmap</a> & icon )
</h3>
Constructs an icon view item and inserts it into the icon view <em>parent</em> using <em>text</em> as the text and <em>icon</em> as the icon.
<h3 class=fn><a name="QIconViewItem-6"></a>QIconViewItem::QIconViewItem ( <a href="qiconview.html">QIconView</a> * parent, <a href="qiconviewitem.html">QIconViewItem</a> * after, const <a href="qstring.html">QString</a> & text, const <a href="qpixmap.html">QPixmap</a> & icon )
</h3>
Constructs an icon view item and inserts it into the icon view <em>parent</em> using <em>text</em> as the text and <em>icon</em> as the icon, after
the icon view item <em>after</em>.
<p> <p>See also <a href="#setPixmap">setPixmap</a>().
<h3 class=fn><a name="QIconViewItem-7"></a>QIconViewItem::QIconViewItem ( <a href="qiconview.html">QIconView</a> * parent, const <a href="qstring.html">QString</a> & text, const <a href="qpicture.html">QPicture</a> & picture )
</h3>
Constructs an icon view item and inserts it into the icon view <em>parent</em> using <em>text</em> as the text and <em>picture</em> as the icon.
<h3 class=fn><a name="QIconViewItem-8"></a>QIconViewItem::QIconViewItem ( <a href="qiconview.html">QIconView</a> * parent, <a href="qiconviewitem.html">QIconViewItem</a> * after, const <a href="qstring.html">QString</a> & text, const <a href="qpicture.html">QPicture</a> & picture )
</h3>
Constructs an icon view item and inserts it into the icon view <em>parent</em> using <em>text</em> as the text and <em>picture</em> as the icon, after
the icon view item <em>after</em>.
<h3 class=fn><a name="~QIconViewItem"></a>QIconViewItem::~QIconViewItem ()<tt> [virtual]</tt>
</h3>
Destroys the icon view item and tells the parent icon view that
the item has been destroyed.
<h3 class=fn>bool <a name="acceptDrop"></a>QIconViewItem::acceptDrop ( const <a href="qmimesource.html">QMimeSource</a> * mime ) const<tt> [virtual]</tt>
</h3>
<p> Returns TRUE if you can drop things with a <a href="qmimesource.html">QMimeSource</a> of <em>mime</em>
onto this item; otherwise returns FALSE.
<p> The default implementation always returns FALSE. You must subclass
QIconViewItem and reimplement <a href="#acceptDrop">acceptDrop</a>() to accept drops.
<p>Examples: <a href="fileiconview-example.html#x836">fileiconview/qfileiconview.cpp</a> and <a href="simple_dd-example.html#x2822">iconview/simple_dd/main.cpp</a>.
<h3 class=fn>void <a name="calcRect"></a>QIconViewItem::calcRect ( const <a href="qstring.html">QString</a> & text_ = QString::null )<tt> [virtual protected]</tt>
</h3>
This virtual function is responsible for calculating the
rectangles returned by <a href="#rect">rect</a>(), <a href="#textRect">textRect</a>() and <a href="#pixmapRect">pixmapRect</a>().
setRect(), <a href="#setTextRect">setTextRect</a>() and <a href="#setPixmapRect">setPixmapRect</a>() are provided mainly
for reimplementations of this function.
<p> <em>text_</em> is an internal parameter which defaults to <a href="qstring.html#QString-null">QString::null</a>.
<h3 class=fn>int <a name="compare"></a>QIconViewItem::compare ( <a href="qiconviewitem.html">QIconViewItem</a> * i ) const<tt> [virtual]</tt>
</h3>
Compares this icon view item to <em>i</em>. Returns -1 if this item is
less than <em>i</em>, 0 if they are equal, and 1 if this icon view item
is greater than <em>i</em>.
<p> The default implementation compares the item keys (<a href="#key">key</a>()) using
<a href="qstring.html#localeAwareCompare">QString::localeAwareCompare</a>(). A reimplementation may use
different values and a different comparison function. Here is a
reimplementation that uses plain Unicode comparison:
<p> <pre>
int MyIconViewItem::compare( QIconViewItem *i ) const
{
return key().compare( i-><a href="#key">key</a>() );
}
</pre>
<p> <p>See also <a href="#key">key</a>(), <a href="qstring.html#localeAwareCompare">QString::localeAwareCompare</a>(), and <a href="qstring.html#compare">QString::compare</a>().
<h3 class=fn>bool <a name="contains"></a>QIconViewItem::contains ( const <a href="qpoint.html">QPoint</a> & pnt ) const
</h3>
Returns TRUE if the item contains the point <em>pnt</em> (in contents
coordinates); otherwise returns FALSE.
<h3 class=fn>bool <a name="dragEnabled"></a>QIconViewItem::dragEnabled () const
</h3>
Returns TRUE if the user is allowed to drag the icon view item;
otherwise returns FALSE.
<p> <p>See also <a href="#setDragEnabled">setDragEnabled</a>().
<h3 class=fn>void <a name="dragEntered"></a>QIconViewItem::dragEntered ()<tt> [virtual protected]</tt>
</h3>
This function is called when a drag enters the item's bounding
rectangle.
<p> The default implementation does nothing; subclasses may
reimplement this function.
<p>Example: <a href="fileiconview-example.html#x837">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn>void <a name="dragLeft"></a>QIconViewItem::dragLeft ()<tt> [virtual protected]</tt>
</h3>
This function is called when a drag leaves the item's bounding
rectangle.
<p> The default implementation does nothing; subclasses may
reimplement this function.
<p>Example: <a href="fileiconview-example.html#x838">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn>bool <a name="dropEnabled"></a>QIconViewItem::dropEnabled () const
</h3>
Returns TRUE if the user is allowed to drop something onto the
item; otherwise returns FALSE.
<p> <p>See also <a href="#setDropEnabled">setDropEnabled</a>().
<h3 class=fn>void <a name="dropped"></a>QIconViewItem::dropped ( <a href="qdropevent.html">QDropEvent</a> * e, const <a href="qvaluelist.html">QValueList</a><QIconDragItem> & lst )<tt> [virtual protected]</tt>
</h3>
<p> This function is called when something is dropped on the item. <em>e</em> provides all the information about the drop. If the drag object
of the drop was a <a href="qicondrag.html">QIconDrag</a>, <em>lst</em> contains the list of the
dropped items. You can get the data by calling
<a href="qicondragitem.html#data">QIconDragItem::data</a>() on each item. If the <em>lst</em> is empty, i.e.
the drag was not a QIconDrag, you must decode the data in <em>e</em> and
work with that.
<p> The default implementation does nothing; subclasses may
reimplement this function.
<p>Examples: <a href="fileiconview-example.html#x839">fileiconview/qfileiconview.cpp</a> and <a href="simple_dd-example.html#x2823">iconview/simple_dd/main.cpp</a>.
<h3 class=fn>int <a name="height"></a>QIconViewItem::height () const
</h3>
Returns the height of the item.
<h3 class=fn><a href="qiconview.html">QIconView</a> * <a name="iconView"></a>QIconViewItem::iconView () const
</h3>
Returns a pointer to this item's icon view parent.
<h3 class=fn>int <a name="index"></a>QIconViewItem::index () const
</h3>
Returns the index of this item in the icon view, or -1 if an error
occurred.
<h3 class=fn>bool <a name="intersects"></a>QIconViewItem::intersects ( const <a href="qrect.html">QRect</a> & r ) const
</h3>
Returns TRUE if the item intersects the rectangle <em>r</em> (in
contents coordinates); otherwise returns FALSE.
<h3 class=fn>bool <a name="isSelectable"></a>QIconViewItem::isSelectable () const
</h3>
Returns TRUE if the item is selectable; otherwise returns FALSE.
<p> <p>See also <a href="#setSelectable">setSelectable</a>().
<h3 class=fn>bool <a name="isSelected"></a>QIconViewItem::isSelected () const
</h3>
Returns TRUE if the item is selected; otherwise returns FALSE.
<p> <p>See also <a href="#setSelected">setSelected</a>().
<p>Example: <a href="fileiconview-example.html#x840">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn><a href="qstring.html">QString</a> <a name="key"></a>QIconViewItem::key () const<tt> [virtual]</tt>
</h3>
Returns the key of the icon view item or <a href="#text">text</a>() if no key has been
explicitly set.
<p> <p>See also <a href="#setKey">setKey</a>() and <a href="#compare">compare</a>().
<h3 class=fn>bool <a name="move"></a>QIconViewItem::move ( int x, int y )<tt> [virtual]</tt>
</h3>
Moves the item to position (<em>x</em>, <em>y</em>) in the icon view (these
are contents coordinates).
<h3 class=fn>bool <a name="move-2"></a>QIconViewItem::move ( const <a href="qpoint.html">QPoint</a> & pnt )<tt> [virtual]</tt>
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Moves the item to the point <em>pnt</em>.
<h3 class=fn>void <a name="moveBy"></a>QIconViewItem::moveBy ( int dx, int dy )<tt> [virtual]</tt>
</h3>
Moves the item <em>dx</em> pixels in the x-direction and <em>dy</em> pixels in
the y-direction.
<h3 class=fn>void <a name="moveBy-2"></a>QIconViewItem::moveBy ( const <a href="qpoint.html">QPoint</a> & pnt )<tt> [virtual]</tt>
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Moves the item by the x, y values in point <em>pnt</em>.
<h3 class=fn><a href="qiconviewitem.html">QIconViewItem</a> * <a name="nextItem"></a>QIconViewItem::nextItem () const
</h3>
Returns a pointer to the next item, or 0 if this is the last item
in the icon view.
<p> To find the first item use <a href="qiconview.html#firstItem">QIconView::firstItem</a>().
<p> Example:
<pre>
QIconViewItem *item;
for ( item = iconView->firstItem(); item; item = item-><a href="#nextItem">nextItem</a>() )
do_something_with( item );
</pre>
<p> <p>See also <a href="#prevItem">prevItem</a>().
<p>Example: <a href="fileiconview-example.html#x841">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn>void <a name="paintFocus"></a>QIconViewItem::paintFocus ( <a href="qpainter.html">QPainter</a> * p, const <a href="qcolorgroup.html">QColorGroup</a> & cg )<tt> [virtual protected]</tt>
</h3>
Paints the focus rectangle of the item using the painter <em>p</em> and
the color group <em>cg</em>.
<h3 class=fn>void <a name="paintItem"></a>QIconViewItem::paintItem ( <a href="qpainter.html">QPainter</a> * p, const <a href="qcolorgroup.html">QColorGroup</a> & cg )<tt> [virtual protected]</tt>
</h3>
Paints the item using the painter <em>p</em> and the color group <em>cg</em>.
If you want the item to be drawn with a different font or color,
reimplement this function, change the values of the color group or
the painter's font, and then call the <a href="#paintItem">QIconViewItem::paintItem</a>()
with the changed values.
<p>Example: <a href="fileiconview-example.html#x842">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn><a href="qpicture.html">QPicture</a> * <a name="picture"></a>QIconViewItem::picture () const<tt> [virtual]</tt>
</h3>
Returns the icon of the icon view item if it is a picture, or 0 if
it is a pixmap. In the latter case use <a href="#pixmap">pixmap</a>() instead. Normally
you set the picture of the item with <a href="#setPicture">setPicture</a>(), but sometimes
it's inconvenient to call setPicture() for every item. So you can
subclass QIconViewItem, reimplement this function and return a
pointer to the item's picture. If you do this, you <em>must</em> call
<a href="#calcRect">calcRect</a>() manually each time the size of this picture changes.
<p> <p>See also <a href="#setPicture">setPicture</a>().
<h3 class=fn><a href="qpixmap.html">QPixmap</a> * <a name="pixmap"></a>QIconViewItem::pixmap () const<tt> [virtual]</tt>
</h3>
Returns the icon of the icon view item if it is a pixmap, or 0 if
it is a picture. In the latter case use <a href="#picture">picture</a>() instead.
Normally you set the pixmap of the item with <a href="#setPixmap">setPixmap</a>(), but
sometimes it's inconvenient to call setPixmap() for every item. So
you can subclass QIconViewItem, reimplement this function and
return a pointer to the item's pixmap. If you do this, you <em>must</em>
call <a href="#calcRect">calcRect</a>() manually each time the size of this pixmap
changes.
<p> <p>See also <a href="#setPixmap">setPixmap</a>().
<p>Example: <a href="fileiconview-example.html#x843">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn><a href="qrect.html">QRect</a> <a name="pixmapRect"></a>QIconViewItem::pixmapRect ( bool relative = TRUE ) const
</h3>
Returns the bounding rectangle of the item's icon.
<p> If <em>relative</em> is TRUE, (the default), the rectangle is relative to
the origin of the item's rectangle. If <em>relative</em> is FALSE, the
returned rectangle is relative to the origin of the icon view's
contents coordinate system.
<p>Example: <a href="fileiconview-example.html#x844">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn><a href="qpoint.html">QPoint</a> <a name="pos"></a>QIconViewItem::pos () const
</h3>
Returns the position of the item (in contents coordinates).
<h3 class=fn><a href="qiconviewitem.html">QIconViewItem</a> * <a name="prevItem"></a>QIconViewItem::prevItem () const
</h3>
Returns a pointer to the previous item, or 0 if this is the first
item in the icon view.
<p> <p>See also <a href="#nextItem">nextItem</a>() and <a href="qiconview.html#firstItem">QIconView::firstItem</a>().
<h3 class=fn><a href="qrect.html">QRect</a> <a name="rect"></a>QIconViewItem::rect () const
</h3>
Returns the bounding rectangle of the item (in contents
coordinates).
<h3 class=fn>void <a name="removeRenameBox"></a>QIconViewItem::removeRenameBox ()<tt> [virtual protected]</tt>
</h3>
Removes the editbox that is used for in-place renaming.
<h3 class=fn>void <a name="rename"></a>QIconViewItem::rename ()
</h3>
Starts in-place renaming of an icon, if allowed.
<p> This function sets up the icon view so that the user can edit the
item text, and then returns. When the user is done, <a href="#setText">setText</a>() will
be called and <a href="qiconview.html#itemRenamed">QIconView::itemRenamed</a>() will be emitted (unless the
user canceled, e.g. by pressing the Escape key).
<p> <p>See also <a href="#setRenameEnabled">setRenameEnabled</a>().
<p>Example: <a href="fileiconview-example.html#x845">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn>bool <a name="renameEnabled"></a>QIconViewItem::renameEnabled () const
</h3>
Returns TRUE if the item can be renamed by the user with in-place
renaming; otherwise returns FALSE.
<p> <p>See also <a href="#setRenameEnabled">setRenameEnabled</a>().
<p>Example: <a href="fileiconview-example.html#x846">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn>void <a name="repaint"></a>QIconViewItem::repaint ()<tt> [virtual]</tt>
</h3>
Repaints the item.
<h3 class=fn>int <a name="rtti"></a>QIconViewItem::rtti () const<tt> [virtual]</tt>
</h3>
Returns 0.
<p> Make your derived classes return their own values for <a href="#rtti">rtti</a>(), so
that you can distinguish between icon view item types. You should
use values greater than 1000, preferably a large random number, to
allow for extensions to this class.
<h3 class=fn>void <a name="setDragEnabled"></a>QIconViewItem::setDragEnabled ( bool allow )<tt> [virtual]</tt>
</h3>
If <em>allow</em> is TRUE, the icon view permits the user to drag the
icon view item either to another position within the icon view or
to somewhere outside of it. If <em>allow</em> is FALSE, the item cannot
be dragged.
<h3 class=fn>void <a name="setDropEnabled"></a>QIconViewItem::setDropEnabled ( bool allow )<tt> [virtual]</tt>
</h3>
If <em>allow</em> is TRUE, the icon view lets the user drop something on
this icon view item.
<h3 class=fn>void <a name="setItemRect"></a>QIconViewItem::setItemRect ( const <a href="qrect.html">QRect</a> & r )<tt> [protected]</tt>
</h3>
Sets the bounding rectangle of the whole item to <em>r</em>. This
function is provided for subclasses which reimplement <a href="#calcRect">calcRect</a>(),
so that they can set the calculated rectangle. <em>Any other use is discouraged.</em>
<p> <p>See also <a href="#calcRect">calcRect</a>(), <a href="#textRect">textRect</a>(), <a href="#setTextRect">setTextRect</a>(), <a href="#pixmapRect">pixmapRect</a>(), and <a href="#setPixmapRect">setPixmapRect</a>().
<h3 class=fn>void <a name="setKey"></a>QIconViewItem::setKey ( const <a href="qstring.html">QString</a> & k )<tt> [virtual]</tt>
</h3>
Sets <em>k</em> as the sort key of the icon view item. By default
<a href="#text">text</a>() is used for sorting.
<p> <p>See also <a href="#compare">compare</a>().
<p>Example: <a href="fileiconview-example.html#x847">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn>void <a name="setPicture"></a>QIconViewItem::setPicture ( const <a href="qpicture.html">QPicture</a> & icon )<tt> [virtual]</tt>
</h3>
Sets <em>icon</em> as the item's icon in the icon view. This function
might be a no-op if you reimplement <a href="#picture">picture</a>().
<p> <p>See also <a href="#picture">picture</a>().
<h3 class=fn>void <a name="setPixmap"></a>QIconViewItem::setPixmap ( const <a href="qpixmap.html">QPixmap</a> & icon )<tt> [virtual]</tt>
</h3>
Sets <em>icon</em> as the item's icon in the icon view. This function
might be a no-op if you reimplement <a href="#pixmap">pixmap</a>().
<p> <b>Note:</b> Pixmaps with individual dimensions larger than 300 pixels may
not be displayed properly, depending on the <a href="qiconview.html#Arrangement-enum">arrangement in use</a>. See the <a href="#pixmap-size-limit">main class
documentation</a> for details.
<p> <p>See also <a href="#pixmap">pixmap</a>().
<h3 class=fn>void <a name="setPixmap-2"></a>QIconViewItem::setPixmap ( const <a href="qpixmap.html">QPixmap</a> & icon, bool recalc, bool redraw = TRUE )<tt> [virtual]</tt>
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Sets <em>icon</em> as the item's icon in the icon view. If <em>recalc</em> is
TRUE, the icon view's layout is recalculated. If <em>redraw</em> is TRUE
(the default), the icon view is repainted.
<p> <b>Note:</b> Pixmaps with individual dimensions larger than 300 pixels may
not be displayed properly, depending on the <a href="qiconview.html#Arrangement-enum">arrangement in use</a>. See the <a href="#pixmap-size-limit">main class
documentation</a> for details.
<p> <p>See also <a href="#pixmap">pixmap</a>().
<h3 class=fn>void <a name="setPixmapRect"></a>QIconViewItem::setPixmapRect ( const <a href="qrect.html">QRect</a> & r )<tt> [protected]</tt>
</h3>
Sets the bounding rectangle of the item's icon to <em>r</em>. This
function is provided for subclasses which reimplement <a href="#calcRect">calcRect</a>(),
so that they can set the calculated rectangle. <em>Any other use is discouraged.</em>
<p> <p>See also <a href="#calcRect">calcRect</a>(), <a href="#pixmapRect">pixmapRect</a>(), <a href="#setItemRect">setItemRect</a>(), and <a href="#setTextRect">setTextRect</a>().
<h3 class=fn>void <a name="setRenameEnabled"></a>QIconViewItem::setRenameEnabled ( bool allow )<tt> [virtual]</tt>
</h3>
If <em>allow</em> is TRUE, the user can rename the icon view item by
clicking on the text (or pressing F2) while the item is selected
(in-place renaming). If <em>allow</em> is FALSE, in-place renaming is
not possible.
<p>Examples: <a href="fileiconview-example.html#x848">fileiconview/qfileiconview.cpp</a>, <a href="iconview-example.html#x1459">iconview/main.cpp</a>, and <a href="simple_dd-example.html#x2824">iconview/simple_dd/main.cpp</a>.
<h3 class=fn>void <a name="setSelectable"></a>QIconViewItem::setSelectable ( bool enable )<tt> [virtual]</tt>
</h3>
Sets this item to be selectable if <em>enable</em> is TRUE (the default)
or unselectable if <em>enable</em> is FALSE.
<p> The user is unable to select a non-selectable item using either
the keyboard or the mouse. (The application programmer can select
an item in code regardless of this setting.)
<p> <p>See also <a href="#isSelectable">isSelectable</a>().
<h3 class=fn>void <a name="setSelected"></a>QIconViewItem::setSelected ( bool s, bool cb )<tt> [virtual]</tt>
</h3>
Selects or unselects the item, depending on <em>s</em>; it may also
unselect other items, depending on <a href="qiconview.html#selectionMode">QIconView::selectionMode</a>() and
<em>cb</em>.
<p> If <em>s</em> is FALSE, the item is unselected.
<p> If <em>s</em> is TRUE and QIconView::selectionMode() is <tt>Single</tt>, the
item is selected and the item previously selected is unselected.
<p> If <em>s</em> is TRUE and QIconView::selectionMode() is <tt>Extended</tt>, the
item is selected. If <em>cb</em> is TRUE, the selection state of the
other items is left unchanged. If <em>cb</em> is FALSE (the default) all
other items are unselected.
<p> If <em>s</em> is TRUE and QIconView::selectionMode() is <tt>Multi</tt>, the
item is selected.
<p> Note that <em>cb</em> is used only if QIconView::selectionMode() is <tt>Extended</tt>; cb defaults to FALSE.
<p> All items whose selection status changes repaint themselves.
<p>Example: <a href="fileiconview-example.html#x849">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn>void <a name="setSelected-2"></a>QIconViewItem::setSelected ( bool s )<tt> [virtual]</tt>
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This variant is equivalent to calling the other variant with <em>cb</em>
set to FALSE.
<h3 class=fn>void <a name="setText"></a>QIconViewItem::setText ( const <a href="qstring.html">QString</a> & text )<tt> [virtual]</tt>
</h3>
Sets <em>text</em> as the text of the icon view item. This function
might be a no-op if you reimplement <a href="#text">text</a>().
<p> <p>See also <a href="#text">text</a>().
<p>Example: <a href="fileiconview-example.html#x850">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn>void <a name="setText-2"></a>QIconViewItem::setText ( const <a href="qstring.html">QString</a> & text, bool recalc, bool redraw = TRUE )<tt> [virtual]</tt>
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Sets <em>text</em> as the text of the icon view item. If <em>recalc</em> is
TRUE, the icon view's layout is recalculated. If <em>redraw</em> is TRUE
(the default), the icon view is repainted.
<p> <p>See also <a href="#text">text</a>().
<h3 class=fn>void <a name="setTextRect"></a>QIconViewItem::setTextRect ( const <a href="qrect.html">QRect</a> & r )<tt> [protected]</tt>
</h3>
Sets the bounding rectangle of the item's text to <em>r</em>. This
function is provided for subclasses which reimplement <a href="#calcRect">calcRect</a>(),
so that they can set the calculated rectangle. <em>Any other use is discouraged.</em>
<p> <p>See also <a href="#calcRect">calcRect</a>(), <a href="#textRect">textRect</a>(), <a href="#setItemRect">setItemRect</a>(), and <a href="#setPixmapRect">setPixmapRect</a>().
<h3 class=fn><a href="qsize.html">QSize</a> <a name="size"></a>QIconViewItem::size () const
</h3>
Returns the size of the item.
<h3 class=fn><a href="qstring.html">QString</a> <a name="text"></a>QIconViewItem::text () const<tt> [virtual]</tt>
</h3>
Returns the text of the icon view item. Normally you set the text
of the item with <a href="#setText">setText</a>(), but sometimes it's inconvenient to
call setText() for every item; so you can subclass QIconViewItem,
reimplement this function, and return the text of the item. If you
do this, you must call <a href="#calcRect">calcRect</a>() manually each time the text
(and therefore its size) changes.
<p> <p>See also <a href="#setText">setText</a>().
<p>Example: <a href="fileiconview-example.html#x851">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn><a href="qrect.html">QRect</a> <a name="textRect"></a>QIconViewItem::textRect ( bool relative = TRUE ) const
</h3>
Returns the bounding rectangle of the item's text.
<p> If <em>relative</em> is TRUE, (the default), the returned rectangle is
relative to the origin of the item's rectangle. If <em>relative</em> is
FALSE, the returned rectangle is relative to the origin of the
icon view's contents coordinate system.
<p>Example: <a href="fileiconview-example.html#x852">fileiconview/qfileiconview.cpp</a>.
<h3 class=fn>int <a name="width"></a>QIconViewItem::width () const
</h3>
Returns the width of the item.
<h3 class=fn>int <a name="x"></a>QIconViewItem::x () const
</h3>
Returns the x-coordinate of the item (in contents coordinates).
<h3 class=fn>int <a name="y"></a>QIconViewItem::y () const
</h3>
Returns the y-coordinate of the item (in contents coordinates).
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright © 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright © 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt 3.3.8</div>
</table></div></address></body>
</html>
|