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
|
'\" t
.TH QIconViewItem 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QIconViewItem \- Single item in a QIconView
.SH SYNOPSIS
\fC#include <qiconview.h>\fR
.PP
Inherits Qt.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQIconViewItem\fR ( QIconView * parent )"
.br
.ti -1c
.BI "\fBQIconViewItem\fR ( QIconView * parent, QIconViewItem * after )"
.br
.ti -1c
.BI "\fBQIconViewItem\fR ( QIconView * parent, const QString & text )"
.br
.ti -1c
.BI "\fBQIconViewItem\fR ( QIconView * parent, QIconViewItem * after, const QString & text )"
.br
.ti -1c
.BI "\fBQIconViewItem\fR ( QIconView * parent, const QString & text, const QPixmap & icon )"
.br
.ti -1c
.BI "\fBQIconViewItem\fR ( QIconView * parent, QIconViewItem * after, const QString & text, const QPixmap & icon )"
.br
.ti -1c
.BI "\fBQIconViewItem\fR ( QIconView * parent, const QString & text, const QPicture & picture )"
.br
.ti -1c
.BI "\fBQIconViewItem\fR ( QIconView * parent, QIconViewItem * after, const QString & text, const QPicture & picture )"
.br
.ti -1c
.BI "virtual \fB~QIconViewItem\fR ()"
.br
.ti -1c
.BI "virtual void \fBsetRenameEnabled\fR ( bool allow )"
.br
.ti -1c
.BI "virtual void \fBsetDragEnabled\fR ( bool allow )"
.br
.ti -1c
.BI "virtual void \fBsetDropEnabled\fR ( bool allow )"
.br
.ti -1c
.BI "virtual QString \fBtext\fR () const"
.br
.ti -1c
.BI "virtual QPixmap * \fBpixmap\fR () const"
.br
.ti -1c
.BI "virtual QPicture * \fBpicture\fR () const"
.br
.ti -1c
.BI "virtual QString \fBkey\fR () const"
.br
.ti -1c
.BI "bool \fBrenameEnabled\fR () const"
.br
.ti -1c
.BI "bool \fBdragEnabled\fR () const"
.br
.ti -1c
.BI "bool \fBdropEnabled\fR () const"
.br
.ti -1c
.BI "QIconView * \fBiconView\fR () const"
.br
.ti -1c
.BI "QIconViewItem * \fBprevItem\fR () const"
.br
.ti -1c
.BI "QIconViewItem * \fBnextItem\fR () const"
.br
.ti -1c
.BI "int \fBindex\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetSelected\fR ( bool s, bool cb )"
.br
.ti -1c
.BI "virtual void \fBsetSelected\fR ( bool s )"
.br
.ti -1c
.BI "virtual void \fBsetSelectable\fR ( bool enable )"
.br
.ti -1c
.BI "bool \fBisSelected\fR () const"
.br
.ti -1c
.BI "bool \fBisSelectable\fR () const"
.br
.ti -1c
.BI "virtual void \fBrepaint\fR ()"
.br
.ti -1c
.BI "virtual bool \fBmove\fR ( int x, int y )"
.br
.ti -1c
.BI "virtual void \fBmoveBy\fR ( int dx, int dy )"
.br
.ti -1c
.BI "virtual bool \fBmove\fR ( const QPoint & pnt )"
.br
.ti -1c
.BI "virtual void \fBmoveBy\fR ( const QPoint & pnt )"
.br
.ti -1c
.BI "QRect \fBrect\fR () const"
.br
.ti -1c
.BI "int \fBx\fR () const"
.br
.ti -1c
.BI "int \fBy\fR () const"
.br
.ti -1c
.BI "int \fBwidth\fR () const"
.br
.ti -1c
.BI "int \fBheight\fR () const"
.br
.ti -1c
.BI "QSize \fBsize\fR () const"
.br
.ti -1c
.BI "QPoint \fBpos\fR () const"
.br
.ti -1c
.BI "QRect \fBtextRect\fR ( bool relative = TRUE ) const"
.br
.ti -1c
.BI "QRect \fBpixmapRect\fR ( bool relative = TRUE ) const"
.br
.ti -1c
.BI "bool \fBcontains\fR ( const QPoint & pnt ) const"
.br
.ti -1c
.BI "bool \fBintersects\fR ( const QRect & r ) const"
.br
.ti -1c
.BI "virtual bool \fBacceptDrop\fR ( const QMimeSource * mime ) const"
.br
.ti -1c
.BI "void \fBrename\fR ()"
.br
.ti -1c
.BI "virtual int \fBcompare\fR ( QIconViewItem * i ) const"
.br
.ti -1c
.BI "virtual void \fBsetText\fR ( const QString & text )"
.br
.ti -1c
.BI "virtual void \fBsetPixmap\fR ( const QPixmap & icon )"
.br
.ti -1c
.BI "virtual void \fBsetPicture\fR ( const QPicture & icon )"
.br
.ti -1c
.BI "virtual void \fBsetText\fR ( const QString & text, bool recalc, bool redraw = TRUE )"
.br
.ti -1c
.BI "virtual void \fBsetPixmap\fR ( const QPixmap & icon, bool recalc, bool redraw = TRUE )"
.br
.ti -1c
.BI "virtual void \fBsetKey\fR ( const QString & k )"
.br
.ti -1c
.BI "virtual int \fBrtti\fR () const"
.br
.in -1c
.SS "Protected Members"
.in +1c
.ti -1c
.BI "virtual void \fBremoveRenameBox\fR ()"
.br
.ti -1c
.BI "virtual void \fBcalcRect\fR ( const QString & text_ = QString::null )"
.br
.ti -1c
.BI "virtual void \fBpaintItem\fR ( QPainter * p, const QColorGroup & cg )"
.br
.ti -1c
.BI "virtual void \fBpaintFocus\fR ( QPainter * p, const QColorGroup & cg )"
.br
.ti -1c
.BI "virtual void \fBdropped\fR ( QDropEvent * e, const QValueList<QIconDragItem> & lst )"
.br
.ti -1c
.BI "virtual void \fBdragEntered\fR ()"
.br
.ti -1c
.BI "virtual void \fBdragLeft\fR ()"
.br
.ti -1c
.BI "void \fBsetItemRect\fR ( const QRect & r )"
.br
.ti -1c
.BI "void \fBsetTextRect\fR ( const QRect & r )"
.br
.ti -1c
.BI "void \fBsetPixmapRect\fR ( const QRect & r )"
.br
.in -1c
.SH DESCRIPTION
The QIconViewItem class provides a single item in a QIconView.
.PP
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 QListView and QListBox in use, both via instantiation and subclassing.
.PP
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:
.PP
.nf
.br
(void) new QIconViewItem(
.br
iconView, // A pointer to a QIconView
.br
"This is the text of the item",
.br
aPixmap );
.br
.fi
.PP
By default the text of an icon view item may not be edited by the user but calling setRenameEnabled(TRUE) will allow the user to perform in-place editing of the item's text.
.PP
When the icon view is deleted all items in it are deleted automatically.
.PP
The QIconView::firstItem() and QIconViewItem::nextItem() functions provide a means of iterating over all the items in a QIconView:
.PP
.nf
.br
QIconViewItem *item;
.br
for ( item = iconView->firstItem(); item; item = item->nextItem() )
.br
do_something_with( item );
.br
.fi
.PP
The item's icon view is available from iconView(), and its position in the icon view from index().
.PP
The item's selection status is available from isSelected() and is set and controlled by setSelected() and isSelectable().
.PP
The text and icon can be set with setText() and setPixmap() and retrieved with text() and pixmap(). The item's sort key defaults to text() but may be set with setKey() and retrieved with key(). The comparison function, compare() uses key().
.PP
Items may be repositioned with move() and moveBy(). An item's geometry is available from rect(), x(), y(), width(), height(), size(), pos(), textRect() and pixmapRect(). You can also test against the position of a point with contains() and intersects().
.PP
To remove an item from an icon view, just delete the item. The QIconViewItem destructor removes it cleanly from its icon view.
.PP
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.
.PP
\fBNote:\fR Pixmaps with individual dimensions larger than 300 pixels may not be displayed properly, depending on the arrangement in use. For example, pixmaps wider than 300 pixels will not be arranged correctly if the icon view uses a QIconView::TopToBottom arrangement, and pixmaps taller than 300 pixels will not be arranged correctly if the icon view uses a QIconView::LeftToRight arrangement.
.PP
See also Advanced Widgets.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QIconViewItem::QIconViewItem ( QIconView * parent )"
Constructs a QIconViewItem and inserts it into icon view \fIparent\fR with no text and a default icon.
.SH "QIconViewItem::QIconViewItem ( QIconView * parent, QIconViewItem * after )"
Constructs a QIconViewItem and inserts it into the icon view \fIparent\fR with no text and a default icon, after the icon view item \fIafter\fR.
.SH "QIconViewItem::QIconViewItem ( QIconView * parent, const QString & text )"
Constructs an icon view item and inserts it into the icon view \fIparent\fR using \fItext\fR as the text and a default icon.
.SH "QIconViewItem::QIconViewItem ( QIconView * parent, QIconViewItem * after, const QString & text )"
Constructs an icon view item and inserts it into the icon view \fIparent\fR using \fItext\fR as the text and a default icon, after the icon view item \fIafter\fR.
.SH "QIconViewItem::QIconViewItem ( QIconView * parent, const QString & text, const QPixmap & icon )"
Constructs an icon view item and inserts it into the icon view \fIparent\fR using \fItext\fR as the text and \fIicon\fR as the icon.
.SH "QIconViewItem::QIconViewItem ( QIconView * parent, QIconViewItem * after, const QString & text, const QPixmap & icon )"
Constructs an icon view item and inserts it into the icon view \fIparent\fR using \fItext\fR as the text and \fIicon\fR as the icon, after the icon view item \fIafter\fR.
.PP
See also setPixmap().
.SH "QIconViewItem::QIconViewItem ( QIconView * parent, const QString & text, const QPicture & picture )"
Constructs an icon view item and inserts it into the icon view \fIparent\fR using \fItext\fR as the text and \fIpicture\fR as the icon.
.SH "QIconViewItem::QIconViewItem ( QIconView * parent, QIconViewItem * after, const QString & text, const QPicture & picture )"
Constructs an icon view item and inserts it into the icon view \fIparent\fR using \fItext\fR as the text and \fIpicture\fR as the icon, after the icon view item \fIafter\fR.
.SH "QIconViewItem::~QIconViewItem ()\fC [virtual]\fR"
Destroys the icon view item and tells the parent icon view that the item has been destroyed.
.SH "bool QIconViewItem::acceptDrop ( const QMimeSource * mime ) const\fC [virtual]\fR"
Returns TRUE if you can drop things with a QMimeSource of \fImime\fR onto this item; otherwise returns FALSE.
.PP
The default implementation always returns FALSE. You must subclass QIconViewItem and reimplement acceptDrop() to accept drops.
.PP
Examples:
.)l fileiconview/qfileiconview.cpp and iconview/simple_dd/main.cpp.
.SH "void QIconViewItem::calcRect ( const QString & text_ = QString::null )\fC [virtual protected]\fR"
This virtual function is responsible for calculating the rectangles returned by rect(), textRect() and pixmapRect(). setRect(), setTextRect() and setPixmapRect() are provided mainly for reimplementations of this function.
.PP
\fItext_\fR is an internal parameter which defaults to QString::null.
.SH "int QIconViewItem::compare ( QIconViewItem * i ) const\fC [virtual]\fR"
Compares this icon view item to \fIi\fR. Returns -1 if this item is less than \fIi\fR, 0 if they are equal, and 1 if this icon view item is greater than \fIi\fR.
.PP
The default implementation compares the item keys (key()) using QString::localeAwareCompare(). A reimplementation may use different values and a different comparison function. Here is a reimplementation that uses plain Unicode comparison:
.PP
.nf
.br
int MyIconViewItem::compare( QIconViewItem *i ) const
.br
{
.br
return key().compare( i->key() );
.br
}
.br
.fi
.PP
See also key(), QString::localeAwareCompare(), and QString::compare().
.SH "bool QIconViewItem::contains ( const QPoint & pnt ) const"
Returns TRUE if the item contains the point \fIpnt\fR (in contents coordinates); otherwise returns FALSE.
.SH "bool QIconViewItem::dragEnabled () const"
Returns TRUE if the user is allowed to drag the icon view item; otherwise returns FALSE.
.PP
See also setDragEnabled().
.SH "void QIconViewItem::dragEntered ()\fC [virtual protected]\fR"
This function is called when a drag enters the item's bounding rectangle.
.PP
The default implementation does nothing; subclasses may reimplement this function.
.PP
Example: fileiconview/qfileiconview.cpp.
.SH "void QIconViewItem::dragLeft ()\fC [virtual protected]\fR"
This function is called when a drag leaves the item's bounding rectangle.
.PP
The default implementation does nothing; subclasses may reimplement this function.
.PP
Example: fileiconview/qfileiconview.cpp.
.SH "bool QIconViewItem::dropEnabled () const"
Returns TRUE if the user is allowed to drop something onto the item; otherwise returns FALSE.
.PP
See also setDropEnabled().
.SH "void QIconViewItem::dropped ( QDropEvent * e, const QValueList<QIconDragItem> & lst )\fC [virtual protected]\fR"
This function is called when something is dropped on the item. \fIe\fR provides all the information about the drop. If the drag object of the drop was a QIconDrag, \fIlst\fR contains the list of the dropped items. You can get the data by calling QIconDragItem::data() on each item. If the \fIlst\fR is empty, i.e. the drag was not a QIconDrag, you must decode the data in \fIe\fR and work with that.
.PP
The default implementation does nothing; subclasses may reimplement this function.
.PP
Examples:
.)l fileiconview/qfileiconview.cpp and iconview/simple_dd/main.cpp.
.SH "int QIconViewItem::height () const"
Returns the height of the item.
.SH "QIconView * QIconViewItem::iconView () const"
Returns a pointer to this item's icon view parent.
.SH "int QIconViewItem::index () const"
Returns the index of this item in the icon view, or -1 if an error occurred.
.SH "bool QIconViewItem::intersects ( const QRect & r ) const"
Returns TRUE if the item intersects the rectangle \fIr\fR (in contents coordinates); otherwise returns FALSE.
.SH "bool QIconViewItem::isSelectable () const"
Returns TRUE if the item is selectable; otherwise returns FALSE.
.PP
See also setSelectable().
.SH "bool QIconViewItem::isSelected () const"
Returns TRUE if the item is selected; otherwise returns FALSE.
.PP
See also setSelected().
.PP
Example: fileiconview/qfileiconview.cpp.
.SH "QString QIconViewItem::key () const\fC [virtual]\fR"
Returns the key of the icon view item or text() if no key has been explicitly set.
.PP
See also setKey() and compare().
.SH "bool QIconViewItem::move ( int x, int y )\fC [virtual]\fR"
Moves the item to position (\fIx\fR, \fIy\fR) in the icon view (these are contents coordinates).
.SH "bool QIconViewItem::move ( const QPoint & pnt )\fC [virtual]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Moves the item to the point \fIpnt\fR.
.SH "void QIconViewItem::moveBy ( int dx, int dy )\fC [virtual]\fR"
Moves the item \fIdx\fR pixels in the x-direction and \fIdy\fR pixels in the y-direction.
.SH "void QIconViewItem::moveBy ( const QPoint & pnt )\fC [virtual]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Moves the item by the x, y values in point \fIpnt\fR.
.SH "QIconViewItem * QIconViewItem::nextItem () const"
Returns a pointer to the next item, or 0 if this is the last item in the icon view.
.PP
To find the first item use QIconView::firstItem().
.PP
Example:
.PP
.nf
.br
QIconViewItem *item;
.br
for ( item = iconView->firstItem(); item; item = item->nextItem() )
.br
do_something_with( item );
.br
.fi
.PP
See also prevItem().
.PP
Example: fileiconview/qfileiconview.cpp.
.SH "void QIconViewItem::paintFocus ( QPainter * p, const QColorGroup & cg )\fC [virtual protected]\fR"
Paints the focus rectangle of the item using the painter \fIp\fR and the color group \fIcg\fR.
.SH "void QIconViewItem::paintItem ( QPainter * p, const QColorGroup & cg )\fC [virtual protected]\fR"
Paints the item using the painter \fIp\fR and the color group \fIcg\fR. 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 QIconViewItem::paintItem() with the changed values.
.PP
Example: fileiconview/qfileiconview.cpp.
.SH "QPicture * QIconViewItem::picture () const\fC [virtual]\fR"
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 pixmap() instead. Normally you set the picture of the item with setPicture(), 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 \fImust\fR call calcRect() manually each time the size of this picture changes.
.PP
See also setPicture().
.SH "QPixmap * QIconViewItem::pixmap () const\fC [virtual]\fR"
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 picture() instead. Normally you set the pixmap of the item with setPixmap(), 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 \fImust\fR call calcRect() manually each time the size of this pixmap changes.
.PP
See also setPixmap().
.PP
Example: fileiconview/qfileiconview.cpp.
.SH "QRect QIconViewItem::pixmapRect ( bool relative = TRUE ) const"
Returns the bounding rectangle of the item's icon.
.PP
If \fIrelative\fR is TRUE, (the default), the rectangle is relative to the origin of the item's rectangle. If \fIrelative\fR is FALSE, the returned rectangle is relative to the origin of the icon view's contents coordinate system.
.PP
Example: fileiconview/qfileiconview.cpp.
.SH "QPoint QIconViewItem::pos () const"
Returns the position of the item (in contents coordinates).
.SH "QIconViewItem * QIconViewItem::prevItem () const"
Returns a pointer to the previous item, or 0 if this is the first item in the icon view.
.PP
See also nextItem() and QIconView::firstItem().
.SH "QRect QIconViewItem::rect () const"
Returns the bounding rectangle of the item (in contents coordinates).
.SH "void QIconViewItem::removeRenameBox ()\fC [virtual protected]\fR"
Removes the editbox that is used for in-place renaming.
.SH "void QIconViewItem::rename ()"
Starts in-place renaming of an icon, if allowed.
.PP
This function sets up the icon view so that the user can edit the item text, and then returns. When the user is done, setText() will be called and QIconView::itemRenamed() will be emitted (unless the user canceled, e.g. by pressing the Escape key).
.PP
See also setRenameEnabled().
.PP
Example: fileiconview/qfileiconview.cpp.
.SH "bool QIconViewItem::renameEnabled () const"
Returns TRUE if the item can be renamed by the user with in-place renaming; otherwise returns FALSE.
.PP
See also setRenameEnabled().
.PP
Example: fileiconview/qfileiconview.cpp.
.SH "void QIconViewItem::repaint ()\fC [virtual]\fR"
Repaints the item.
.SH "int QIconViewItem::rtti () const\fC [virtual]\fR"
Returns 0.
.PP
Make your derived classes return their own values for rtti(), 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.
.SH "void QIconViewItem::setDragEnabled ( bool allow )\fC [virtual]\fR"
If \fIallow\fR 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 \fIallow\fR is FALSE, the item cannot be dragged.
.SH "void QIconViewItem::setDropEnabled ( bool allow )\fC [virtual]\fR"
If \fIallow\fR is TRUE, the icon view lets the user drop something on this icon view item.
.SH "void QIconViewItem::setItemRect ( const QRect & r )\fC [protected]\fR"
Sets the bounding rectangle of the whole item to \fIr\fR. This function is provided for subclasses which reimplement calcRect(), so that they can set the calculated rectangle. \fIAny other use is discouraged.\fR
.PP
See also calcRect(), textRect(), setTextRect(), pixmapRect(), and setPixmapRect().
.SH "void QIconViewItem::setKey ( const QString & k )\fC [virtual]\fR"
Sets \fIk\fR as the sort key of the icon view item. By default text() is used for sorting.
.PP
See also compare().
.PP
Example: fileiconview/qfileiconview.cpp.
.SH "void QIconViewItem::setPicture ( const QPicture & icon )\fC [virtual]\fR"
Sets \fIicon\fR as the item's icon in the icon view. This function might be a no-op if you reimplement picture().
.PP
See also picture().
.SH "void QIconViewItem::setPixmap ( const QPixmap & icon )\fC [virtual]\fR"
Sets \fIicon\fR as the item's icon in the icon view. This function might be a no-op if you reimplement pixmap().
.PP
\fBNote:\fR Pixmaps with individual dimensions larger than 300 pixels may not be displayed properly, depending on the arrangement in use. See the main class documentation for details.
.PP
See also pixmap().
.SH "void QIconViewItem::setPixmap ( const QPixmap & icon, bool recalc, bool redraw = TRUE )\fC [virtual]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Sets \fIicon\fR as the item's icon in the icon view. If \fIrecalc\fR is TRUE, the icon view's layout is recalculated. If \fIredraw\fR is TRUE (the default), the icon view is repainted.
.PP
\fBNote:\fR Pixmaps with individual dimensions larger than 300 pixels may not be displayed properly, depending on the arrangement in use. See the main class documentation for details.
.PP
See also pixmap().
.SH "void QIconViewItem::setPixmapRect ( const QRect & r )\fC [protected]\fR"
Sets the bounding rectangle of the item's icon to \fIr\fR. This function is provided for subclasses which reimplement calcRect(), so that they can set the calculated rectangle. \fIAny other use is discouraged.\fR
.PP
See also calcRect(), pixmapRect(), setItemRect(), and setTextRect().
.SH "void QIconViewItem::setRenameEnabled ( bool allow )\fC [virtual]\fR"
If \fIallow\fR 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 \fIallow\fR is FALSE, in-place renaming is not possible.
.PP
Examples:
.)l fileiconview/qfileiconview.cpp, iconview/main.cpp, and iconview/simple_dd/main.cpp.
.SH "void QIconViewItem::setSelectable ( bool enable )\fC [virtual]\fR"
Sets this item to be selectable if \fIenable\fR is TRUE (the default) or unselectable if \fIenable\fR is FALSE.
.PP
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.)
.PP
See also isSelectable().
.SH "void QIconViewItem::setSelected ( bool s, bool cb )\fC [virtual]\fR"
Selects or unselects the item, depending on \fIs\fR; it may also unselect other items, depending on QIconView::selectionMode() and \fIcb\fR.
.PP
If \fIs\fR is FALSE, the item is unselected.
.PP
If \fIs\fR is TRUE and QIconView::selectionMode() is \fCSingle\fR, the item is selected and the item previously selected is unselected.
.PP
If \fIs\fR is TRUE and QIconView::selectionMode() is \fCExtended\fR, the item is selected. If \fIcb\fR is TRUE, the selection state of the other items is left unchanged. If \fIcb\fR is FALSE (the default) all other items are unselected.
.PP
If \fIs\fR is TRUE and QIconView::selectionMode() is \fCMulti\fR, the item is selected.
.PP
Note that \fIcb\fR is used only if QIconView::selectionMode() is \fCExtended\fR; cb defaults to FALSE.
.PP
All items whose selection status changes repaint themselves.
.PP
Example: fileiconview/qfileiconview.cpp.
.SH "void QIconViewItem::setSelected ( bool s )\fC [virtual]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
This variant is equivalent to calling the other variant with \fIcb\fR set to FALSE.
.SH "void QIconViewItem::setText ( const QString & text )\fC [virtual]\fR"
Sets \fItext\fR as the text of the icon view item. This function might be a no-op if you reimplement text().
.PP
See also text().
.PP
Example: fileiconview/qfileiconview.cpp.
.SH "void QIconViewItem::setText ( const QString & text, bool recalc, bool redraw = TRUE )\fC [virtual]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Sets \fItext\fR as the text of the icon view item. If \fIrecalc\fR is TRUE, the icon view's layout is recalculated. If \fIredraw\fR is TRUE (the default), the icon view is repainted.
.PP
See also text().
.SH "void QIconViewItem::setTextRect ( const QRect & r )\fC [protected]\fR"
Sets the bounding rectangle of the item's text to \fIr\fR. This function is provided for subclasses which reimplement calcRect(), so that they can set the calculated rectangle. \fIAny other use is discouraged.\fR
.PP
See also calcRect(), textRect(), setItemRect(), and setPixmapRect().
.SH "QSize QIconViewItem::size () const"
Returns the size of the item.
.SH "QString QIconViewItem::text () const\fC [virtual]\fR"
Returns the text of the icon view item. Normally you set the text of the item with setText(), 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 calcRect() manually each time the text (and therefore its size) changes.
.PP
See also setText().
.PP
Example: fileiconview/qfileiconview.cpp.
.SH "QRect QIconViewItem::textRect ( bool relative = TRUE ) const"
Returns the bounding rectangle of the item's text.
.PP
If \fIrelative\fR is TRUE, (the default), the returned rectangle is relative to the origin of the item's rectangle. If \fIrelative\fR is FALSE, the returned rectangle is relative to the origin of the icon view's contents coordinate system.
.PP
Example: fileiconview/qfileiconview.cpp.
.SH "int QIconViewItem::width () const"
Returns the width of the item.
.SH "int QIconViewItem::x () const"
Returns the x-coordinate of the item (in contents coordinates).
.SH "int QIconViewItem::y () const"
Returns the y-coordinate of the item (in contents coordinates).
.SH "SEE ALSO"
.BR http://doc.trolltech.com/qiconviewitem.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive Qt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using Qt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR [email protected] .
Please include the name of the manual page (qiconviewitem.3qt) and the Qt
version (3.3.8).
|