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/kernel/qiconset.cpp:204 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>QIconSet 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>QIconSet Class Reference</h1>
|
---|
33 |
|
---|
34 | <p>The QIconSet class provides a set of icons with different
|
---|
35 | styles and sizes.
|
---|
36 | <a href="#details">More...</a>
|
---|
37 | <p><tt>#include <<a href="qiconset-h.html">qiconset.h</a>></tt>
|
---|
38 | <p><a href="qiconset-members.html">List of all member functions.</a>
|
---|
39 | <h2>Public Members</h2>
|
---|
40 | <ul>
|
---|
41 | <li class=fn>enum <a href="#Size-enum"><b>Size</b></a> { Automatic, Small, Large }</li>
|
---|
42 | <li class=fn>enum <a href="#Mode-enum"><b>Mode</b></a> { Normal, Disabled, Active }</li>
|
---|
43 | <li class=fn>enum <a href="#State-enum"><b>State</b></a> { On, Off }</li>
|
---|
44 | <li class=fn><a href="#QIconSet"><b>QIconSet</b></a> ()</li>
|
---|
45 | <li class=fn><a href="#QIconSet-2"><b>QIconSet</b></a> ( const QPixmap & pixmap, Size size = Automatic )</li>
|
---|
46 | <li class=fn><a href="#QIconSet-3"><b>QIconSet</b></a> ( const QPixmap & smallPix, const QPixmap & largePix )</li>
|
---|
47 | <li class=fn><a href="#QIconSet-4"><b>QIconSet</b></a> ( const QIconSet & other )</li>
|
---|
48 | <li class=fn>virtual <a href="#~QIconSet"><b>~QIconSet</b></a> ()</li>
|
---|
49 | <li class=fn>void <a href="#reset"><b>reset</b></a> ( const QPixmap & pixmap, Size size )</li>
|
---|
50 | <li class=fn>virtual void <a href="#setPixmap"><b>setPixmap</b></a> ( const QPixmap & pixmap, Size size, Mode mode = Normal, State state = Off )</li>
|
---|
51 | <li class=fn>virtual void <a href="#setPixmap-2"><b>setPixmap</b></a> ( const QString & fileName, Size size, Mode mode = Normal, State state = Off )</li>
|
---|
52 | <li class=fn>QPixmap <a href="#pixmap"><b>pixmap</b></a> ( Size size, Mode mode, State state = Off ) const</li>
|
---|
53 | <li class=fn>QPixmap pixmap ( Size size, bool enabled, State state = Off ) const <em>(obsolete)</em></li>
|
---|
54 | <li class=fn>QPixmap <a href="#pixmap-3"><b>pixmap</b></a> () const</li>
|
---|
55 | <li class=fn>bool <a href="#isGenerated"><b>isGenerated</b></a> ( Size size, Mode mode, State state = Off ) const</li>
|
---|
56 | <li class=fn>void <a href="#clearGenerated"><b>clearGenerated</b></a> ()</li>
|
---|
57 | <li class=fn>void <a href="#installIconFactory"><b>installIconFactory</b></a> ( QIconFactory * factory )</li>
|
---|
58 | <li class=fn>bool <a href="#isNull"><b>isNull</b></a> () const</li>
|
---|
59 | <li class=fn>void <a href="#detach"><b>detach</b></a> ()</li>
|
---|
60 | <li class=fn>QIconSet & <a href="#operator-eq"><b>operator=</b></a> ( const QIconSet & other )</li>
|
---|
61 | </ul>
|
---|
62 | <h2>Static Public Members</h2>
|
---|
63 | <ul>
|
---|
64 | <li class=fn>void <a href="#setIconSize"><b>setIconSize</b></a> ( Size which, const QSize & size )</li>
|
---|
65 | <li class=fn>const QSize & <a href="#iconSize"><b>iconSize</b></a> ( Size which )</li>
|
---|
66 | </ul>
|
---|
67 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
68 |
|
---|
69 | <p> The QIconSet class provides a set of icons with different
|
---|
70 | styles and sizes.
|
---|
71 | <p>
|
---|
72 |
|
---|
73 |
|
---|
74 |
|
---|
75 | <p> A QIconSet can generate smaller, larger, active, and disabled pixmaps
|
---|
76 | from the set of icons it is given. Such pixmaps are used by
|
---|
77 | <a href="qtoolbutton.html">QToolButton</a>, <a href="qheader.html">QHeader</a>, <a href="qpopupmenu.html">QPopupMenu</a>, etc. to show an icon representing a
|
---|
78 | particular action.
|
---|
79 | <p> The simplest use of QIconSet is to create one from a <a href="qpixmap.html">QPixmap</a> and then
|
---|
80 | use it, allowing Qt to work out all the required icon styles and
|
---|
81 | sizes. For example:
|
---|
82 | <p> <pre>
|
---|
83 | <a href="qtoolbutton.html">QToolButton</a> *but = new <a href="qtoolbutton.html">QToolButton</a>( <a href="#QIconSet">QIconSet</a>( QPixmap("open.xpm") ), ... );
|
---|
84 | </pre>
|
---|
85 |
|
---|
86 | <p> Using whichever pixmaps you specify as a base, QIconSet provides a
|
---|
87 | set of six icons, each with a <a href="#Size-enum">Size</a> and a <a href="#Mode-enum">Mode</a>: Small Normal,
|
---|
88 | Small Disabled, Small Active, Large Normal, Large Disabled, and
|
---|
89 | Large Active.
|
---|
90 | <p> An additional set of six icons can be provided for widgets that have
|
---|
91 | an "On" or "Off" state, like checkable menu items or toggleable
|
---|
92 | toolbuttons. If you provide pixmaps for the "On" state, but not for
|
---|
93 | the "Off" state, the QIconSet will provide the "Off" pixmaps. You may
|
---|
94 | specify icons for both states in you wish.
|
---|
95 | <p> You can set any of the icons using <a href="#setPixmap">setPixmap</a>().
|
---|
96 | <p> When you retrieve a pixmap using <a href="#pixmap">pixmap</a>(Size, Mode, State),
|
---|
97 | QIconSet will return the icon that has been set or previously
|
---|
98 | generated for that size, mode and state combination. If none is
|
---|
99 | available, QIconSet will ask the icon factory. If the icon factory
|
---|
100 | cannot provide any (the default), QIconSet generates a pixmap based
|
---|
101 | on the pixmaps it has been given and returns it.
|
---|
102 | <p> The <a href="#Mode-enum">Disabled</a> appearance is computed using an algorithm that
|
---|
103 | produces results very similar to those used in Microsoft Windows
|
---|
104 | 95. The <a href="#Mode-enum">Active</a> appearance is identical to the <a href="#Mode-enum">Normal</a>
|
---|
105 | appearance unless you use setPixmap() to set it to something
|
---|
106 | special.
|
---|
107 | <p> When scaling icons, QIconSet uses <a href="qimage.html#smoothScale">smooth scaling</a>, which can partially blend the color component
|
---|
108 | of pixmaps. If the results look poor, the best solution
|
---|
109 | is to supply pixmaps in both large and small sizes.
|
---|
110 | <p> You can use the static function <a href="#setIconSize">setIconSize</a>() to set the preferred
|
---|
111 | size of the generated large/small icons. The default small size is
|
---|
112 | 22 x 22, while the default large size is 32 x 32. These sizes only
|
---|
113 | affect generated icons.
|
---|
114 | <p> The <a href="#isGenerated">isGenerated</a>() function returns TRUE if an icon was generated by
|
---|
115 | QIconSet or by a factory; <a href="#clearGenerated">clearGenerated</a>() clears all cached
|
---|
116 | pixmaps.
|
---|
117 | <p> <h3> Making Classes that Use QIconSet
|
---|
118 | </h3>
|
---|
119 | <a name="1"></a><p> If you write your own widgets that have an option to set a small
|
---|
120 | pixmap, consider allowing a QIconSet to be set for that pixmap. The
|
---|
121 | Qt class <a href="qtoolbutton.html">QToolButton</a> is an example of such a widget.
|
---|
122 | <p> Provide a method to set a QIconSet, and when you draw the icon, choose
|
---|
123 | whichever icon is appropriate for the current state of your widget.
|
---|
124 | For example:
|
---|
125 | <pre>
|
---|
126 | void MyWidget::drawIcon( <a href="qpainter.html">QPainter</a>* p, QPoint pos )
|
---|
127 | {
|
---|
128 | p-><a href="qpainter.html#drawPixmap">drawPixmap</a>( pos, icons->pixmap(
|
---|
129 | QIconSet::<a href="#Size-enum">Small</a>,
|
---|
130 | isEnabled() ? QIconSet::<a href="#Mode-enum">Normal</a> :
|
---|
131 | QIconSet::<a href="#Mode-enum">Disabled</a>,
|
---|
132 | isEnabled() ? QIconSet::<a href="#State-enum">On</a> :
|
---|
133 | QIconSet::<a href="#State-enum">Off</a>));
|
---|
134 | }
|
---|
135 | </pre>
|
---|
136 |
|
---|
137 | <p> You might also make use of the <a href="#Mode-enum">Active</a> mode, perhaps making your
|
---|
138 | widget <a href="#Mode-enum">Active</a> when the mouse is over the widget (see <a href="qwidget.html#enterEvent">QWidget::enterEvent</a>()), while the mouse is pressed pending the
|
---|
139 | release that will activate the function, or when it is the currently
|
---|
140 | selected item. If the widget can be toggled, the "On" mode might be
|
---|
141 | used to draw a different icon.
|
---|
142 | <p> <center><img src="iconset.png" alt="QIconSet"></center>
|
---|
143 | <p> <p>See also <a href="qiconfactory.html">QIconFactory</a>, <a href="qpixmap.html">QPixmap</a>, <a href="qmainwindow.html#usesBigPixmaps-prop">QMainWindow::usesBigPixmaps</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Iconic Label</a>, <a href="graphics.html">Graphics Classes</a>, <a href="images.html">Image Processing Classes</a>, and <a href="shared.html">Implicitly and Explicitly Shared Classes</a>.
|
---|
144 |
|
---|
145 | <hr><h2>Member Type Documentation</h2>
|
---|
146 | <h3 class=fn><a name="Mode-enum"></a>QIconSet::Mode</h3>
|
---|
147 |
|
---|
148 | <p> This enum type describes the mode for which a pixmap is intended to be
|
---|
149 | used.
|
---|
150 | The currently defined modes are:
|
---|
151 | <ul>
|
---|
152 | <li><tt>QIconSet::Normal</tt> -
|
---|
153 | Display the pixmap when the user is
|
---|
154 | not interacting with the icon, but the
|
---|
155 | functionality represented by the icon is available.
|
---|
156 | <li><tt>QIconSet::Disabled</tt> -
|
---|
157 | Display the pixmap when the
|
---|
158 | functionality represented by the icon is not available.
|
---|
159 | <li><tt>QIconSet::Active</tt> -
|
---|
160 | Display the pixmap when the
|
---|
161 | functionality represented by the icon is available and
|
---|
162 | the user is interacting with the icon, for example, moving the
|
---|
163 | mouse over it or clicking it.
|
---|
164 | </ul>
|
---|
165 | <h3 class=fn><a name="Size-enum"></a>QIconSet::Size</h3>
|
---|
166 |
|
---|
167 | <p> This enum type describes the size at which a pixmap is intended to be
|
---|
168 | used.
|
---|
169 | The currently defined sizes are:
|
---|
170 | <ul>
|
---|
171 | <li><tt>QIconSet::Automatic</tt> - The size of the pixmap is determined from its
|
---|
172 | pixel size. This is a useful default.
|
---|
173 | <li><tt>QIconSet::Small</tt> - The pixmap is the smaller of two.
|
---|
174 | <li><tt>QIconSet::Large</tt> - The pixmap is the larger of two.
|
---|
175 | </ul><p> If a Small pixmap is not set by <a href="#setPixmap">QIconSet::setPixmap</a>(), the Large
|
---|
176 | pixmap will be automatically scaled down to the size of a small pixmap
|
---|
177 | to generate the Small pixmap when required. Similarly, a Small pixmap
|
---|
178 | will be automatically scaled up to generate a Large pixmap. The
|
---|
179 | preferred sizes for large/small generated icons can be set using
|
---|
180 | <a href="#setIconSize">setIconSize</a>().
|
---|
181 | <p> <p>See also <a href="#setIconSize">setIconSize</a>(), <a href="#iconSize">iconSize</a>(), <a href="#setPixmap">setPixmap</a>(), <a href="#pixmap">pixmap</a>(), and <a href="qmainwindow.html#usesBigPixmaps-prop">QMainWindow::usesBigPixmaps</a>.
|
---|
182 |
|
---|
183 | <h3 class=fn><a name="State-enum"></a>QIconSet::State</h3>
|
---|
184 |
|
---|
185 | <p> This enum describes the state for which a pixmap is intended to be
|
---|
186 | used. The <em>state</em> can be:
|
---|
187 | <ul>
|
---|
188 | <li><tt>QIconSet::Off</tt> - Display the pixmap when the widget is in an "off" state
|
---|
189 | <li><tt>QIconSet::On</tt> - Display the pixmap when the widget is in an "on" state
|
---|
190 | </ul><p> <p>See also <a href="#setPixmap">setPixmap</a>() and <a href="#pixmap">pixmap</a>().
|
---|
191 |
|
---|
192 | <hr><h2>Member Function Documentation</h2>
|
---|
193 | <h3 class=fn><a name="QIconSet"></a>QIconSet::QIconSet ()
|
---|
194 | </h3>
|
---|
195 | Constructs a null icon set.
|
---|
196 | <p> <p>See also <a href="#setPixmap">setPixmap</a>() and <a href="#reset">reset</a>().
|
---|
197 |
|
---|
198 | <h3 class=fn><a name="QIconSet-2"></a>QIconSet::QIconSet ( const <a href="qpixmap.html">QPixmap</a> & pixmap, <a href="qiconset.html#Size-enum">Size</a> size = Automatic )
|
---|
199 | </h3>
|
---|
200 | Constructs an icon set for which the Normal pixmap is <em>pixmap</em>,
|
---|
201 | which is assumed to be of size <em>size</em>.
|
---|
202 | <p> The default for <em>size</em> is <a href="#Size-enum">Automatic</a>, which means that QIconSet
|
---|
203 | will determine whether the pixmap is Small or Large from its pixel
|
---|
204 | size. Pixmaps less than the width of a small generated icon are
|
---|
205 | considered to be Small. You can use <a href="#setIconSize">setIconSize</a>() to set the
|
---|
206 | preferred size of a generated icon.
|
---|
207 | <p> <p>See also <a href="#setIconSize">setIconSize</a>() and <a href="#reset">reset</a>().
|
---|
208 |
|
---|
209 | <h3 class=fn><a name="QIconSet-3"></a>QIconSet::QIconSet ( const <a href="qpixmap.html">QPixmap</a> & smallPix, const <a href="qpixmap.html">QPixmap</a> & largePix )
|
---|
210 | </h3> Creates an iconset which uses the pixmap <em>smallPix</em> for for
|
---|
211 | displaying a small icon, and the pixmap <em>largePix</em> for displaying a
|
---|
212 | large icon.
|
---|
213 |
|
---|
214 | <h3 class=fn><a name="QIconSet-4"></a>QIconSet::QIconSet ( const <a href="qiconset.html">QIconSet</a> & other )
|
---|
215 | </h3>
|
---|
216 | Constructs a copy of <em>other</em>. This is very fast.
|
---|
217 |
|
---|
218 | <h3 class=fn><a name="~QIconSet"></a>QIconSet::~QIconSet ()<tt> [virtual]</tt>
|
---|
219 | </h3>
|
---|
220 | Destroys the icon set and frees any allocated resources.
|
---|
221 |
|
---|
222 | <h3 class=fn>void <a name="clearGenerated"></a>QIconSet::clearGenerated ()
|
---|
223 | </h3>
|
---|
224 | Clears all cached pixmaps, including those obtained from an
|
---|
225 | eventual <a href="qiconfactory.html">QIconFactory</a>.
|
---|
226 |
|
---|
227 | <h3 class=fn>void <a name="detach"></a>QIconSet::detach ()
|
---|
228 | </h3>
|
---|
229 | Detaches this icon set from others with which it may share data.
|
---|
230 | <p> You will never need to call this function; other QIconSet functions
|
---|
231 | call it as necessary.
|
---|
232 |
|
---|
233 | <h3 class=fn>const <a href="qsize.html">QSize</a> & <a name="iconSize"></a>QIconSet::iconSize ( <a href="qiconset.html#Size-enum">Size</a> which )<tt> [static]</tt>
|
---|
234 | </h3>
|
---|
235 | If <em>which</em> is Small, returns the preferred size of a small
|
---|
236 | generated icon; if <em>which</em> is Large, returns the preferred size
|
---|
237 | of a large generated icon.
|
---|
238 | <p> <p>See also <a href="#setIconSize">setIconSize</a>().
|
---|
239 |
|
---|
240 | <h3 class=fn>void <a name="installIconFactory"></a>QIconSet::installIconFactory ( <a href="qiconfactory.html">QIconFactory</a> * factory )
|
---|
241 | </h3>
|
---|
242 | Installs <em>factory</em> as the icon factory for this iconset. The
|
---|
243 | icon factory is used to generates pixmaps not set by the user.
|
---|
244 | <p> If no icon factory is installed, <a href="qiconfactory.html#defaultFactory">QIconFactory::defaultFactory</a>()
|
---|
245 | is used.
|
---|
246 |
|
---|
247 | <h3 class=fn>bool <a name="isGenerated"></a>QIconSet::isGenerated ( <a href="qiconset.html#Size-enum">Size</a> size, <a href="qiconset.html#Mode-enum">Mode</a> mode, <a href="qiconset.html#State-enum">State</a> state = Off ) const
|
---|
248 | </h3>
|
---|
249 | Returns TRUE if the pixmap with size <em>size</em>, mode <em>mode</em> and
|
---|
250 | state <em>state</em> is generated from other pixmaps; otherwise returns
|
---|
251 | FALSE.
|
---|
252 | <p> A pixmap obtained from a <a href="qiconfactory.html">QIconFactory</a> is considered non-generated.
|
---|
253 |
|
---|
254 | <h3 class=fn>bool <a name="isNull"></a>QIconSet::isNull () const
|
---|
255 | </h3>
|
---|
256 | Returns TRUE if the icon set is empty; otherwise returns FALSE.
|
---|
257 |
|
---|
258 | <h3 class=fn><a href="qiconset.html">QIconSet</a> & <a name="operator-eq"></a>QIconSet::operator= ( const <a href="qiconset.html">QIconSet</a> & other )
|
---|
259 | </h3>
|
---|
260 | Assigns <em>other</em> to this icon set and returns a reference to this
|
---|
261 | icon set.
|
---|
262 | <p> <p>See also <a href="#detach">detach</a>().
|
---|
263 |
|
---|
264 | <h3 class=fn><a href="qpixmap.html">QPixmap</a> <a name="pixmap"></a>QIconSet::pixmap ( <a href="qiconset.html#Size-enum">Size</a> size, <a href="qiconset.html#Mode-enum">Mode</a> mode, <a href="qiconset.html#State-enum">State</a> state = Off ) const
|
---|
265 | </h3>
|
---|
266 | Returns a pixmap with size <em>size</em>, mode <em>mode</em> and state <em>state</em>, generating one if necessary. Generated pixmaps are cached.
|
---|
267 |
|
---|
268 | <h3 class=fn><a href="qpixmap.html">QPixmap</a> <a name="pixmap-2"></a>QIconSet::pixmap ( <a href="qiconset.html#Size-enum">Size</a> size, bool enabled, <a href="qiconset.html#State-enum">State</a> state = Off ) const
|
---|
269 | </h3> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
270 | <p> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
271 | <p> This is the same as <a href="#pixmap">pixmap</a>(<em>size</em>, <em>enabled</em>, <em>state</em>).
|
---|
272 |
|
---|
273 | <h3 class=fn><a href="qpixmap.html">QPixmap</a> <a name="pixmap-3"></a>QIconSet::pixmap () const
|
---|
274 | </h3>
|
---|
275 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
276 | <p> Returns the pixmap originally provided to the constructor or to
|
---|
277 | <a href="#reset">reset</a>(). This is the Normal pixmap of unspecified Size.
|
---|
278 | <p> <p>See also <a href="#reset">reset</a>().
|
---|
279 |
|
---|
280 | <h3 class=fn>void <a name="reset"></a>QIconSet::reset ( const <a href="qpixmap.html">QPixmap</a> & pixmap, <a href="qiconset.html#Size-enum">Size</a> size )
|
---|
281 | </h3>
|
---|
282 | Sets this icon set to use pixmap <em>pixmap</em> for the Normal pixmap,
|
---|
283 | assuming it to be of size <em>size</em>.
|
---|
284 | <p> This is equivalent to assigning QIconSet(<em>pixmap</em>, <em>size</em>) to this
|
---|
285 | icon set.
|
---|
286 | <p> This function does nothing if <em>pixmap</em> is a null pixmap.
|
---|
287 |
|
---|
288 | <h3 class=fn>void <a name="setIconSize"></a>QIconSet::setIconSize ( <a href="qiconset.html#Size-enum">Size</a> which, const <a href="qsize.html">QSize</a> & size )<tt> [static]</tt>
|
---|
289 | </h3>
|
---|
290 | Set the preferred size for all small or large icons that are
|
---|
291 | generated after this call. If <em>which</em> is Small, sets the preferred
|
---|
292 | size of small generated icons to <em>size</em>. Similarly, if <em>which</em> is
|
---|
293 | Large, sets the preferred size of large generated icons to <em>size</em>.
|
---|
294 | <p> Note that cached icons will not be regenerated, so it is recommended
|
---|
295 | that you set the preferred icon sizes before generating any icon sets.
|
---|
296 | Also note that the preferred icon sizes will be ignored for icon sets
|
---|
297 | that have been created using both small and large pixmaps.
|
---|
298 | <p> <p>See also <a href="#iconSize">iconSize</a>().
|
---|
299 |
|
---|
300 | <h3 class=fn>void <a name="setPixmap"></a>QIconSet::setPixmap ( const <a href="qpixmap.html">QPixmap</a> & pixmap, <a href="qiconset.html#Size-enum">Size</a> size, <a href="qiconset.html#Mode-enum">Mode</a> mode = Normal, <a href="qiconset.html#State-enum">State</a> state = Off )<tt> [virtual]</tt>
|
---|
301 | </h3>
|
---|
302 | Sets this icon set to provide pixmap <em>pixmap</em> for size <em>size</em>, mode <em>mode</em> and state <em>state</em>. The icon set may also use <em>pixmap</em> for
|
---|
303 | generating other pixmaps if they are not explicitly set.
|
---|
304 | <p> The <em>size</em> can be one of Automatic, Large or Small. If Automatic is
|
---|
305 | used, QIconSet will determine if the pixmap is Small or Large from its
|
---|
306 | pixel size.
|
---|
307 | <p> Pixmaps less than the width of a small generated icon are
|
---|
308 | considered to be Small. You can use <a href="#setIconSize">setIconSize</a>() to set the preferred
|
---|
309 | size of a generated icon.
|
---|
310 | <p> This function does nothing if <em>pixmap</em> is a null pixmap.
|
---|
311 | <p> <p>See also <a href="#reset">reset</a>().
|
---|
312 |
|
---|
313 | <h3 class=fn>void <a name="setPixmap-2"></a>QIconSet::setPixmap ( const <a href="qstring.html">QString</a> & fileName, <a href="qiconset.html#Size-enum">Size</a> size, <a href="qiconset.html#Mode-enum">Mode</a> mode = Normal, <a href="qiconset.html#State-enum">State</a> state = Off )<tt> [virtual]</tt>
|
---|
314 | </h3>
|
---|
315 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
316 | <p> The pixmap is loaded from <em>fileName</em> when it becomes necessary.
|
---|
317 |
|
---|
318 | <!-- eof -->
|
---|
319 | <hr><p>
|
---|
320 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
321 | Copyright © 1995-2007
|
---|
322 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
323 | <table width=100% cellspacing=0 border=0><tr>
|
---|
324 | <td>Copyright © 2007
|
---|
325 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
326 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
327 | </table></div></address></body>
|
---|
328 | </html>
|
---|