Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 3f684444755c5ad1181cdd5a97348f3c > files > 1195

PyQt4-devel-4.7.4-2.fc14.i686.rpm

<?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>QGraphicsPixmapItem 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">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QGraphicsPixmapItem Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QGraphicsPixmapItem class provides a pixmap item that you can add to a <a href="qgraphicsscene.html">QGraphicsScene</a>. <a href="#details">More...</a></p>
<p>Inherits <a href="qgraphicsitem.html">QGraphicsItem</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qgraphicspixmapitem.html#ShapeMode-enum">ShapeMode</a></b> { MaskShape, BoundingRectShape, HeuristicMaskShape }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qgraphicspixmapitem.html#QGraphicsPixmapItem">__init__</a></b> (<i>self</i>, QGraphicsItem&#160;<i>parent</i>&#160;=&#160;None, QGraphicsScene&#160;<i>scene</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qgraphicspixmapitem.html#QGraphicsPixmapItem-2">__init__</a></b> (<i>self</i>, QPixmap, QGraphicsItem&#160;<i>parent</i>&#160;=&#160;None, QGraphicsScene&#160;<i>scene</i>&#160;=&#160;None)</li><li><div class="fn" />QRectF <b><a href="qgraphicspixmapitem.html#boundingRect">boundingRect</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicspixmapitem.html#contains">contains</a></b> (<i>self</i>, QPointF)</li><li><div class="fn" />bool <b><a href="qgraphicspixmapitem.html#isObscuredBy">isObscuredBy</a></b> (<i>self</i>, QGraphicsItem)</li><li><div class="fn" />QPointF <b><a href="qgraphicspixmapitem.html#offset">offset</a></b> (<i>self</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicspixmapitem.html#opaqueArea">opaqueArea</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicspixmapitem.html#paint">paint</a></b> (<i>self</i>, QPainter, QStyleOptionGraphicsItem, QWidget)</li><li><div class="fn" />QPixmap <b><a href="qgraphicspixmapitem.html#pixmap">pixmap</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicspixmapitem.html#setOffset">setOffset</a></b> (<i>self</i>, QPointF)</li><li><div class="fn" /><b><a href="qgraphicspixmapitem.html#setOffset-2">setOffset</a></b> (<i>self</i>, float, float)</li><li><div class="fn" /><b><a href="qgraphicspixmapitem.html#setPixmap">setPixmap</a></b> (<i>self</i>, QPixmap)</li><li><div class="fn" /><b><a href="qgraphicspixmapitem.html#setShapeMode">setShapeMode</a></b> (<i>self</i>, ShapeMode)</li><li><div class="fn" /><b><a href="qgraphicspixmapitem.html#setTransformationMode">setTransformationMode</a></b> (<i>self</i>, Qt.TransformationMode)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicspixmapitem.html#shape">shape</a></b> (<i>self</i>)</li><li><div class="fn" />ShapeMode <b><a href="qgraphicspixmapitem.html#shapeMode">shapeMode</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.TransformationMode <b><a href="qgraphicspixmapitem.html#transformationMode">transformationMode</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qgraphicspixmapitem.html#type">type</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QGraphicsPixmapItem class provides a pixmap item that you can add to a <a href="qgraphicsscene.html">QGraphicsScene</a>.</p>
<p>To set the item's pixmap, pass a <a href="qpixmap.html">QPixmap</a> to QGraphicsPixmapItem's constructor, or call the <a href="qgraphicspixmapitem.html#setPixmap">setPixmap</a>() function. The <a href="qgraphicspixmapitem.html#pixmap">pixmap</a>() function returns the current pixmap.</p>
<p>QGraphicsPixmapItem uses pixmap's optional alpha mask to provide a reasonable implementation of <a href="qgraphicspixmapitem.html#boundingRect">boundingRect</a>(), <a href="qgraphicspixmapitem.html#shape">shape</a>(), and <a href="qgraphicspixmapitem.html#contains">contains</a>().</p>
<p align="center"><img src="images/graphicsview-pixmapitem.png" /></p><p>The pixmap is drawn at the item's (0, 0) coordinate, as returned by <a href="qgraphicspixmapitem.html#offset">offset</a>(). You can change the drawing offset by calling <a href="qgraphicspixmapitem.html#setOffset">setOffset</a>().</p>
<p>You can set the pixmap's transformation mode by calling <a href="qgraphicspixmapitem.html#setTransformationMode">setTransformationMode</a>(). By default, <a href="qt.html#TransformationMode-enum">Qt.FastTransformation</a> is used, which provides fast, non-smooth scaling. <a href="qt.html#TransformationMode-enum">Qt.SmoothTransformation</a> enables <a href="qpainter.html#RenderHint-enum">QPainter.SmoothPixmapTransform</a> on the painter, and the quality depends on the platform and viewport. The result is usually not as good as calling QPixmap.scale() directly. Call <a href="qgraphicspixmapitem.html#transformationMode">transformationMode</a>() to get the current transformation mode for the item.</p>
<p>See also <a href="qgraphicspathitem.html">QGraphicsPathItem</a>, <a href="qgraphicsrectitem.html">QGraphicsRectItem</a>, <a href="qgraphicsellipseitem.html">QGraphicsEllipseItem</a>, <a href="qgraphicstextitem.html">QGraphicsTextItem</a>, <a href="qgraphicspolygonitem.html">QGraphicsPolygonItem</a>, <a href="qgraphicslineitem.html">QGraphicsLineItem</a>, and <a href="graphicsview.html">The Graphics View Framework</a>.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="ShapeMode-enum" />QGraphicsPixmapItem.ShapeMode</h3><p>This enum describes how <a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a> calculates its shape and opaque area.</p>
<p>The default value is MaskShape.</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QGraphicsPixmapItem.MaskShape</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">The shape is determined by calling <a href="qpixmap.html#mask">QPixmap.mask</a>(). This shape includes only the opaque pixels of the pixmap. Because the shape is more complex, however, it can be slower than the other modes, and uses more memory.</td></tr>
<tr><td valign="top"><tt>QGraphicsPixmapItem.BoundingRectShape</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The shape is determined by tracing the outline of the pixmap. This is the fastest shape mode, but it does not take into account any transparent areas on the pixmap.</td></tr>
<tr><td valign="top"><tt>QGraphicsPixmapItem.HeuristicMaskShape</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">The shape is determine by calling <a href="qpixmap.html#createHeuristicMask">QPixmap.createHeuristicMask</a>(). The performance and memory consumption is similar to MaskShape.</td></tr>
</table></p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QGraphicsPixmapItem" />QGraphicsPixmapItem.__init__ (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>parent</i>&#160;=&#160;None, <a href="qgraphicsscene.html">QGraphicsScene</a>&#160;<i>scene</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>The <i>scene</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a <a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a>. <i>parent</i> is passed to <a href="qgraphicsitem.html">QGraphicsItem</a>'s constructor.</p>
<p>See also <a href="qgraphicsscene.html#addItem">QGraphicsScene.addItem</a>().</p>
<h3 class="fn"><a name="QGraphicsPixmapItem-2" />QGraphicsPixmapItem.__init__ (<i>self</i>, <a href="qpixmap.html">QPixmap</a>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>parent</i>&#160;=&#160;None, <a href="qgraphicsscene.html">QGraphicsScene</a>&#160;<i>scene</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>The <i>scene</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a <a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a>, using <i>pixmap</i> as the default pixmap. <i>parent</i> is passed to <a href="qgraphicsitem.html">QGraphicsItem</a>'s constructor.</p>
<p>See also <a href="qgraphicsscene.html#addItem">QGraphicsScene.addItem</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/~QGraphicsPixmapItem" />
<h3 class="fn"><a name="boundingRect" /><a href="qrectf.html">QRectF</a> QGraphicsPixmapItem.boundingRect (<i>self</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#boundingRect">QGraphicsItem.boundingRect</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/contains" />
<h3 class="fn"><a name="contains" />bool QGraphicsPixmapItem.contains (<i>self</i>, <a href="qpointf.html">QPointF</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#contains">QGraphicsItem.contains</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/isObscuredBy" />
<h3 class="fn"><a name="isObscuredBy" />bool QGraphicsPixmapItem.isObscuredBy (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#isObscuredBy">QGraphicsItem.isObscuredBy</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/offset" />
<h3 class="fn"><a name="offset" /><a href="qpointf.html">QPointF</a> QGraphicsPixmapItem.offset (<i>self</i>)</h3><p>Returns the pixmap item's <i>offset</i>, which defines the point of the top-left corner of the pixmap, in local coordinates.</p>
<p>See also <a href="qgraphicspixmapitem.html#setOffset">setOffset</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/opaqueArea" />
<h3 class="fn"><a name="opaqueArea" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsPixmapItem.opaqueArea (<i>self</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#opaqueArea">QGraphicsItem.opaqueArea</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/paint" />
<h3 class="fn"><a name="paint" />QGraphicsPixmapItem.paint (<i>self</i>, <a href="qpainter.html">QPainter</a>, <a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a>, <a href="qwidget.html">QWidget</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#paint">QGraphicsItem.paint</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/pixmap" />
<h3 class="fn"><a name="pixmap" /><a href="qpixmap.html">QPixmap</a> QGraphicsPixmapItem.pixmap (<i>self</i>)</h3><p>Returns the item's pixmap, or an invalid <a href="qpixmap.html">QPixmap</a> if no pixmap has been set.</p>
<p>See also <a href="qgraphicspixmapitem.html#setPixmap">setPixmap</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/setOffset" />
<h3 class="fn"><a name="setOffset" />QGraphicsPixmapItem.setOffset (<i>self</i>, <a href="qpointf.html">QPointF</a>)</h3><p>Sets the pixmap item's offset to <i>offset</i>. <a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a> will draw its pixmap using <i>offset</i> for its top-left corner.</p>
<p>See also <a href="qgraphicspixmapitem.html#offset">offset</a>().</p>
<h3 class="fn"><a name="setOffset-2" />QGraphicsPixmapItem.setOffset (<i>self</i>, float, float)</h3><p>This convenience function is equivalent to calling setOffset(<a href="qpointf.html">QPointF</a>(<i>x</i>, <i>y</i>)).</p>
<p>This function was introduced in Qt 4.3.</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/setPixmap" />
<h3 class="fn"><a name="setPixmap" />QGraphicsPixmapItem.setPixmap (<i>self</i>, <a href="qpixmap.html">QPixmap</a>)</h3><p>Sets the item's pixmap to <i>pixmap</i>.</p>
<p>See also <a href="qgraphicspixmapitem.html#pixmap">pixmap</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/setShapeMode" />
<h3 class="fn"><a name="setShapeMode" />QGraphicsPixmapItem.setShapeMode (<i>self</i>, <a href="qgraphicspixmapitem.html#ShapeMode-enum">ShapeMode</a>)</h3><p>Sets the item's shape mode to <i>mode</i>. The shape mode describes how <a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a> calculates its shape. The default mode is <a href="qgraphicspixmapitem.html#ShapeMode-enum">MaskShape</a>.</p>
<p>See also <a href="qgraphicspixmapitem.html#shapeMode">shapeMode</a>() and <a href="qgraphicspixmapitem.html#ShapeMode-enum">ShapeMode</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/setTransformationMode" />
<h3 class="fn"><a name="setTransformationMode" />QGraphicsPixmapItem.setTransformationMode (<i>self</i>, <a href="qt.html#TransformationMode-enum">Qt.TransformationMode</a>)</h3><p>Sets the pixmap item's transformation mode to <i>mode</i>, and toggles an update of the item. The default mode is <a href="qt.html#TransformationMode-enum">Qt.FastTransformation</a>, which provides quick transformation with no smoothing.</p>
<p><a href="qt.html#TransformationMode-enum">Qt.SmoothTransformation</a> enables <a href="qpainter.html#RenderHint-enum">QPainter.SmoothPixmapTransform</a> on the painter, and the quality depends on the platform and viewport. The result is usually not as good as calling QPixmap.scale() directly.</p>
<p>See also <a href="qgraphicspixmapitem.html#transformationMode">transformationMode</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/shape" />
<h3 class="fn"><a name="shape" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsPixmapItem.shape (<i>self</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#shape">QGraphicsItem.shape</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/shapeMode" />
<h3 class="fn"><a name="shapeMode" /><a href="qgraphicspixmapitem.html#ShapeMode-enum">ShapeMode</a> QGraphicsPixmapItem.shapeMode (<i>self</i>)</h3><p>Returns the item's shape mode. The shape mode describes how <a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a> calculates its shape. The default mode is <a href="qgraphicspixmapitem.html#ShapeMode-enum">MaskShape</a>.</p>
<p>See also <a href="qgraphicspixmapitem.html#setShapeMode">setShapeMode</a>() and <a href="qgraphicspixmapitem.html#ShapeMode-enum">ShapeMode</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/transformationMode" />
<h3 class="fn"><a name="transformationMode" /><a href="qt.html#TransformationMode-enum">Qt.TransformationMode</a> QGraphicsPixmapItem.transformationMode (<i>self</i>)</h3><p>Returns the transformation mode of the pixmap. The default mode is <a href="qt.html#TransformationMode-enum">Qt.FastTransformation</a>, which provides quick transformation with no smoothing.</p>
<p>See also <a href="qgraphicspixmapitem.html#setTransformationMode">setTransformationMode</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/type" />
<h3 class="fn"><a name="type" />int QGraphicsPixmapItem.type (<i>self</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#type">QGraphicsItem.type</a>().</p>
<p /><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.4 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.3</td></tr></table></div></address></body></html>