1
<?xml version="1.0" encoding="iso-8859-1"?>
3
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/gui/image/qiconengine.cpp -->
7
<title>Qt 4.0: QIconEngine Class Reference</title>
8
<style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
9
a:link { color: #004faf; text-decoration: none }
10
a:visited { color: #672967; text-decoration: none }
11
td.postheader { font-family: sans-serif }
12
tr.address { font-family: sans-serif }
13
body { background: #ffffff; color: black; }</style>
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
19
<td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> · <a href="annotated.html"><font color="#004faf">Annotated</font></a> · <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> · <a href="functions.html"><font color="#004faf">Functions</font></a></td>
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">QIconEngine Class Reference</h1>
21
<p>The QIconEngine class provides an abstract base class for <a href="qicon.html">QIcon</a> renderers. <a href="#details">More...</a></p>
22
<pre>#include <QIconEngine></pre><p>Part of the <a href="qtgui.html">QtGui</a> module.</p>
24
<li><a href="qiconengine-members.html">List of all members, including inherited members</a></li>
26
<a name="public-functions"></a>
27
<h3>Public Functions</h3>
29
<li><div class="fn"/>virtual <b><a href="qiconengine.html#dtor.QIconEngine">~QIconEngine</a></b> ()</li>
30
<li><div class="fn"/>virtual QSize <b><a href="qiconengine.html#actualSize">actualSize</a></b> ( const QSize & <i>size</i>, QIcon::Mode <i>mode</i>, QIcon::State <i>state</i> )</li>
31
<li><div class="fn"/>virtual void <b><a href="qiconengine.html#addFile">addFile</a></b> ( const QString & <i>fileName</i>, const QSize & <i>size</i>, QIcon::Mode <i>mode</i>, QIcon::State <i>state</i> )</li>
32
<li><div class="fn"/>virtual void <b><a href="qiconengine.html#addPixmap">addPixmap</a></b> ( const QPixmap & <i>pixmap</i>, QIcon::Mode <i>mode</i>, QIcon::State <i>state</i> )</li>
33
<li><div class="fn"/>virtual void <b><a href="qiconengine.html#paint">paint</a></b> ( QPainter * <i>painter</i>, const QRect & <i>rect</i>, QIcon::Mode <i>mode</i>, QIcon::State <i>state</i> ) = 0</li>
34
<li><div class="fn"/>virtual QPixmap <b><a href="qiconengine.html#pixmap">pixmap</a></b> ( const QSize & <i>size</i>, QIcon::Mode <i>mode</i>, QIcon::State <i>state</i> )</li>
36
<a name="details"></a>
38
<h2>Detailed Description</h2>
39
<p>The QIconEngine class provides an abstract base class for <a href="qicon.html">QIcon</a> renderers.</p>
40
<p>An icon engine provides the rendering functions for a <a href="qicon.html">QIcon</a>. Each icon has a corresponding icon engine that is responsible for drawing the icon with a requested size, mode and state.</p>
41
<p>The icon is rendered by the <a href="qiconengine.html#paint">paint</a>() function, and the icon can additionally be obtained as a pixmap with the <a href="qiconengine.html#pixmap">pixmap</a>() function (the default implementation simply uses <a href="qiconengine.html#paint">paint</a>() to achieve this). The <a href="qiconengine.html#addPixmap">addPixmap</a>() function can be used to add new pixmaps to the icon engine, and is used by <a href="qicon.html">QIcon</a> to add specialized custom pixmaps.</p>
42
<p>The <a href="qiconengine.html#paint">paint</a>(), <a href="qiconengine.html#pixmap">pixmap</a>(), and <a href="qiconengine.html#addPixmap">addPixmap</a>() functions are all virtual, and can therefore be reimplemented in subclasses of QIconEngine.</p>
43
<p>See also <a href="qiconengineplugin.html">QIconEnginePlugin</a>.</p>
45
<h2>Member Function Documentation</h2>
46
<h3 class="fn"><a name="dtor.QIconEngine"></a>QIconEngine::~QIconEngine () <tt> [virtual]</tt></h3>
47
<p>Destroys the icon engine.</p>
48
<h3 class="fn"><a name="actualSize"></a><a href="qsize.html">QSize</a> QIconEngine::actualSize ( const <a href="qsize.html">QSize</a> & <i>size</i>, <a href="qicon.html#Mode-enum">QIcon::Mode</a> <i>mode</i>, <a href="qicon.html#State-enum">QIcon::State</a> <i>state</i> ) <tt> [virtual]</tt></h3>
49
<p>Returns the actual size of the icon the engine provides for the requested <i>size</i>, <i>mode</i> and <i>state</i>. The default implementation returns the given <i>size</i>.</p>
50
<h3 class="fn"><a name="addFile"></a>void QIconEngine::addFile ( const <a href="qstring.html">QString</a> & <i>fileName</i>, const <a href="qsize.html">QSize</a> & <i>size</i>, <a href="qicon.html#Mode-enum">QIcon::Mode</a> <i>mode</i>, <a href="qicon.html#State-enum">QIcon::State</a> <i>state</i> ) <tt> [virtual]</tt></h3>
51
<p>Called by <a href="qicon.html#addFile">QIcon::addFile</a>(). Adds a specialized pixmap from the file with the given <i>fileName</i>, <i>size</i>, <i>mode</i> and <i>state</i>. The default pixmap-based engine stores any supplied file names, and it loads the pixmaps on demand instead of using scaled pixmaps if the size of a pixmap matches the size of icon requested. Custom icon engines that implement scalable vector formats are free to ignores any extra files.</p>
52
<h3 class="fn"><a name="addPixmap"></a>void QIconEngine::addPixmap ( const <a href="qpixmap.html">QPixmap</a> & <i>pixmap</i>, <a href="qicon.html#Mode-enum">QIcon::Mode</a> <i>mode</i>, <a href="qicon.html#State-enum">QIcon::State</a> <i>state</i> ) <tt> [virtual]</tt></h3>
53
<p>Called by <a href="qicon.html#addPixmap">QIcon::addPixmap</a>(). Adds a specialized <i>pixmap</i> for the given <i>mode</i> and <i>state</i>. The default pixmap-based engine stores any supplied pixmaps, and it uses them instead of scaled pixmaps if the size of a pixmap matches the size of icon requested. Custom icon engines that implement scalable vector formats are free to ignores any extra pixmaps.</p>
54
<h3 class="fn"><a name="paint"></a>void QIconEngine::paint ( <a href="qpainter.html">QPainter</a> * <i>painter</i>, const <a href="qrect.html">QRect</a> & <i>rect</i>, <a href="qicon.html#Mode-enum">QIcon::Mode</a> <i>mode</i>, <a href="qicon.html#State-enum">QIcon::State</a> <i>state</i> ) <tt> [pure virtual]</tt></h3>
55
<p>Uses the given <i>painter</i> to paint the icon with the required <i>mode</i> and <i>state</i> into the rectangle <i>rect</i>.</p>
56
<h3 class="fn"><a name="pixmap"></a><a href="qpixmap.html">QPixmap</a> QIconEngine::pixmap ( const <a href="qsize.html">QSize</a> & <i>size</i>, <a href="qicon.html#Mode-enum">QIcon::Mode</a> <i>mode</i>, <a href="qicon.html#State-enum">QIcon::State</a> <i>state</i> ) <tt> [virtual]</tt></h3>
57
<p>Returns the icon as a pixmap with the required <i>size</i>, <i>mode</i>, and <i>state</i>. The default implementation creates a new pixmap and calls <a href="qiconengine.html#paint">paint</a>() to fill it.</p>
58
<p /><address><hr /><div align="center">
59
<table width="100%" cellspacing="0" border="0"><tr class="address">
60
<td width="30%">Copyright © 2005 <a href="trolltech.html">Trolltech</a></td>
61
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
62
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
63
</tr></table></div></address></body>