You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tqt3/doc/man/man3/tqiconviewitem.3qt

577 lines
26 KiB

'\" t
.TH TQIconViewItem 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
TQIconViewItem \- Single item in a TQIconView
.SH SYNOPSIS
\fC#include <tqiconview.h>\fR
.PP
Inherits Qt.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBTQIconViewItem\fR ( TQIconView * parent )"
.br
.ti -1c
.BI "\fBTQIconViewItem\fR ( TQIconView * parent, TQIconViewItem * after )"
.br
.ti -1c
.BI "\fBTQIconViewItem\fR ( TQIconView * parent, const TQString & text )"
.br
.ti -1c
.BI "\fBTQIconViewItem\fR ( TQIconView * parent, TQIconViewItem * after, const TQString & text )"
.br
.ti -1c
.BI "\fBTQIconViewItem\fR ( TQIconView * parent, const TQString & text, const QPixmap & icon )"
.br
.ti -1c
.BI "\fBTQIconViewItem\fR ( TQIconView * parent, TQIconViewItem * after, const TQString & text, const QPixmap & icon )"
.br
.ti -1c
.BI "\fBTQIconViewItem\fR ( TQIconView * parent, const TQString & text, const QPicture & picture )"
.br
.ti -1c
.BI "\fBTQIconViewItem\fR ( TQIconView * parent, TQIconViewItem * after, const TQString & text, const QPicture & picture )"
.br
.ti -1c
.BI "virtual \fB~TQIconViewItem\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 TQString \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 TQString \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 "TQIconView * \fBiconView\fR () const"
.br
.ti -1c
.BI "TQIconViewItem * \fBprevItem\fR () const"
.br
.ti -1c
.BI "TQIconViewItem * \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 ( TQIconViewItem * i ) const"
.br
.ti -1c
.BI "virtual void \fBsetText\fR ( const TQString & 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 TQString & 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 TQString & 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 TQString & text_ = TQString::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 TQValueList<TQIconDragItem> & 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 TQIconViewItem class provides a single item in a TQIconView.
.PP
A TQIconViewItem contains an icon, a string and optionally a sort key, and can display itself in a TQIconView. 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 TQIconViewItem and insert it into a TQIconView is to construct the item passing the constructor a pointer to the icon view, a string and an icon:
.PP
.nf
.br
(void) new TQIconViewItem(
.br
iconView, // A pointer to a TQIconView
.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 TQIconView::firstItem() and TQIconViewItem::nextItem() functions provide a means of iterating over all the items in a TQIconView:
.PP
.nf
.br
TQIconViewItem *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 TQIconViewItem 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 TQIconView::TopToBottom arrangement, and pixmaps taller than 300 pixels will not be arranged correctly if the icon view uses a TQIconView::LeftToRight arrangement.
.PP
See also Advanced Widgets.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "TQIconViewItem::TQIconViewItem ( TQIconView * parent )"
Constructs a TQIconViewItem and inserts it into icon view \fIparent\fR with no text and a default icon.
.SH "TQIconViewItem::TQIconViewItem ( TQIconView * parent, TQIconViewItem * after )"
Constructs a TQIconViewItem and inserts it into the icon view \fIparent\fR with no text and a default icon, after the icon view item \fIafter\fR.
.SH "TQIconViewItem::TQIconViewItem ( TQIconView * parent, const TQString & 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 "TQIconViewItem::TQIconViewItem ( TQIconView * parent, TQIconViewItem * after, const TQString & 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 "TQIconViewItem::TQIconViewItem ( TQIconView * parent, const TQString & 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 "TQIconViewItem::TQIconViewItem ( TQIconView * parent, TQIconViewItem * after, const TQString & 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 "TQIconViewItem::TQIconViewItem ( TQIconView * parent, const TQString & 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 "TQIconViewItem::TQIconViewItem ( TQIconView * parent, TQIconViewItem * after, const TQString & 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 "TQIconViewItem::~TQIconViewItem ()\fC [virtual]\fR"
Destroys the icon view item and tells the parent icon view that the item has been destroyed.
.SH "bool TQIconViewItem::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 TQIconViewItem and reimplement acceptDrop() to accept drops.
.PP
Examples:
.)l fileiconview/qfileiconview.cpp and iconview/simple_dd/main.cpp.
.SH "void TQIconViewItem::calcRect ( const TQString & text_ = TQString::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 TQString::null.
.SH "int TQIconViewItem::compare ( TQIconViewItem * 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 TQString::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( TQIconViewItem *i ) const
.br
{
.br
return key().compare( i->key() );
.br
}
.br
.fi
.PP
See also key(), TQString::localeAwareCompare(), and TQString::compare().
.SH "bool TQIconViewItem::contains ( const QPoint & pnt ) const"
Returns TRUE if the item contains the point \fIpnt\fR (in contents coordinates); otherwise returns FALSE.
.SH "bool TQIconViewItem::dragEnabled () const"
Returns TRUE if the user is allowed to drag the icon view item; otherwise returns FALSE.
.PP
See also setDragEnabled().
.SH "void TQIconViewItem::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 TQIconViewItem::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 TQIconViewItem::dropEnabled () const"
Returns TRUE if the user is allowed to drop something onto the item; otherwise returns FALSE.
.PP
See also setDropEnabled().
.SH "void TQIconViewItem::dropped ( QDropEvent * e, const TQValueList<TQIconDragItem> & 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 TQIconDrag, \fIlst\fR contains the list of the dropped items. You can get the data by calling TQIconDragItem::data() on each item. If the \fIlst\fR is empty, i.e. the drag was not a TQIconDrag, 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 TQIconViewItem::height () const"
Returns the height of the item.
.SH "TQIconView * TQIconViewItem::iconView () const"
Returns a pointer to this item's icon view parent.
.SH "int TQIconViewItem::index () const"
Returns the index of this item in the icon view, or -1 if an error occurred.
.SH "bool TQIconViewItem::intersects ( const QRect & r ) const"
Returns TRUE if the item intersects the rectangle \fIr\fR (in contents coordinates); otherwise returns FALSE.
.SH "bool TQIconViewItem::isSelectable () const"
Returns TRUE if the item is selectable; otherwise returns FALSE.
.PP
See also setSelectable().
.SH "bool TQIconViewItem::isSelected () const"
Returns TRUE if the item is selected; otherwise returns FALSE.
.PP
See also setSelected().
.PP
Example: fileiconview/qfileiconview.cpp.
.SH "TQString TQIconViewItem::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 TQIconViewItem::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 TQIconViewItem::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 TQIconViewItem::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 TQIconViewItem::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 "TQIconViewItem * TQIconViewItem::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 TQIconView::firstItem().
.PP
Example:
.PP
.nf
.br
TQIconViewItem *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 TQIconViewItem::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 TQIconViewItem::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 TQIconViewItem::paintItem() with the changed values.
.PP
Example: fileiconview/qfileiconview.cpp.
.SH "QPicture * TQIconViewItem::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 TQIconViewItem, 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 * TQIconViewItem::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 TQIconViewItem, 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 TQIconViewItem::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 TQIconViewItem::pos () const"
Returns the position of the item (in contents coordinates).
.SH "TQIconViewItem * TQIconViewItem::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 TQIconView::firstItem().
.SH "QRect TQIconViewItem::rect () const"
Returns the bounding rectangle of the item (in contents coordinates).
.SH "void TQIconViewItem::removeRenameBox ()\fC [virtual protected]\fR"
Removes the editbox that is used for in-place renaming.
.SH "void TQIconViewItem::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 TQIconView::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 TQIconViewItem::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 TQIconViewItem::repaint ()\fC [virtual]\fR"
Repaints the item.
.SH "int TQIconViewItem::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 TQIconViewItem::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 TQIconViewItem::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 TQIconViewItem::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 TQIconViewItem::setKey ( const TQString & 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 TQIconViewItem::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 TQIconViewItem::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 TQIconViewItem::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 TQIconViewItem::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 TQIconViewItem::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 TQIconViewItem::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 TQIconViewItem::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 TQIconView::selectionMode() and \fIcb\fR.
.PP
If \fIs\fR is FALSE, the item is unselected.
.PP
If \fIs\fR is TRUE and TQIconView::selectionMode() is \fCSingle\fR, the item is selected and the item previously selected is unselected.
.PP
If \fIs\fR is TRUE and TQIconView::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 TQIconView::selectionMode() is \fCMulti\fR, the item is selected.
.PP
Note that \fIcb\fR is used only if TQIconView::selectionMode() is \fCExtended\fR; cb defaults to FALSE.
.PP
All items whose selection status changes repaint themselves.
.PP
Example: fileiconview/qfileiconview.cpp.
.SH "void TQIconViewItem::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 TQIconViewItem::setText ( const TQString & 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 TQIconViewItem::setText ( const TQString & 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 TQIconViewItem::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 TQIconViewItem::size () const"
Returns the size of the item.
.SH "TQString TQIconViewItem::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 TQIconViewItem, 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 TQIconViewItem::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 TQIconViewItem::width () const"
Returns the width of the item.
.SH "int TQIconViewItem::x () const"
Returns the x-coordinate of the item (in contents coordinates).
.SH "int TQIconViewItem::y () const"
Returns the y-coordinate of the item (in contents coordinates).
.SH "SEE ALSO"
.BR http://doc.trolltech.com/tqiconviewitem.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 TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt 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 qt-bugs@trolltech.com .
Please include the name of the manual page (tqiconviewitem.3qt) and the Qt
version (3.3.8).