<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html><head><title>QIconEngine Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } td.postheader { font-family: sans-serif } tr.address { font-family: sans-serif } body { background: #ffffff; color: black; } </style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><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="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QIconEngine Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QIconEngine class provides an abstract base class for <a href="qicon.html">QIcon</a> renderers. <a href="#details">More...</a></p> <p>Inherited by <a href="qiconenginev2.html">QIconEngineV2</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qiconengine.html#QIconEngine">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qiconengine.html#QIconEngine-2">__init__</a></b> (<i>self</i>, QIconEngine)</li><li><div class="fn" />QSize <b><a href="qiconengine.html#actualSize">actualSize</a></b> (<i>self</i>, QSize <i>size</i>, QIcon.Mode <i>mode</i>, QIcon.State <i>state</i>)</li><li><div class="fn" /><b><a href="qiconengine.html#addFile">addFile</a></b> (<i>self</i>, QString <i>fileName</i>, QSize <i>size</i>, QIcon.Mode <i>mode</i>, QIcon.State <i>state</i>)</li><li><div class="fn" /><b><a href="qiconengine.html#addPixmap">addPixmap</a></b> (<i>self</i>, QPixmap <i>pixmap</i>, QIcon.Mode <i>mode</i>, QIcon.State <i>state</i>)</li><li><div class="fn" /><b><a href="qiconengine.html#paint">paint</a></b> (<i>self</i>, QPainter <i>painter</i>, QRect <i>rect</i>, QIcon.Mode <i>mode</i>, QIcon.State <i>state</i>)</li><li><div class="fn" />QPixmap <b><a href="qiconengine.html#pixmap">pixmap</a></b> (<i>self</i>, QSize <i>size</i>, QIcon.Mode <i>mode</i>, QIcon.State <i>state</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QIconEngine class provides an abstract base class for <a href="qicon.html">QIcon</a> renderers.</p> <p><b>Use <a href="qiconenginev2.html">QIconEngineV2</a> instead.</b></p> <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> <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> <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> <hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QIconEngine" />QIconEngine.__init__ (<i>self</i>)</h3><h3 class="fn"><a name="QIconEngine-2" />QIconEngine.__init__ (<i>self</i>, <a href="qiconengine.html">QIconEngine</a>)</h3><h3 class="fn"><a name="actualSize" /><a href="qsize.html">QSize</a> QIconEngine.actualSize (<i>self</i>, <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>)</h3><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> <h3 class="fn"><a name="addFile" />QIconEngine.addFile (<i>self</i>, QString <i>fileName</i>, <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>)</h3><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> <h3 class="fn"><a name="addPixmap" />QIconEngine.addPixmap (<i>self</i>, <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>)</h3><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> <h3 class="fn"><a name="paint" />QIconEngine.paint (<i>self</i>, <a href="qpainter.html">QPainter</a> <i>painter</i>, <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>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><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> <h3 class="fn"><a name="pixmap" /><a href="qpixmap.html">QPixmap</a> QIconEngine.pixmap (<i>self</i>, <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>)</h3><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> <address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.10.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt 4.8.5</td></tr></table></div></address></body></html>