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