Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 4185

qt4-doc-4.6.3-0.2mdv2010.2.i586.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- qgraphicsitem.cpp -->
<head>
  <title>Qt 4.6: QGraphicsPixmapItem Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//QGraphicsPixmapItem"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QGraphicsPixmapItem Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span>
</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>
<pre> #include &lt;QGraphicsPixmapItem&gt;</pre><p>Inherits <a href="qgraphicsitem.html">QGraphicsItem</a>.</p>
<p>This class was introduced in Qt 4.2.</p>
<ul>
<li><a href="qgraphicspixmapitem-members.html">List of all members, including inherited members</a></li>
</ul>
<hr />
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#ShapeMode-enum">ShapeMode</a></b> { MaskShape, BoundingRectShape, HeuristicMaskShape }</td></tr>
</table>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#QGraphicsPixmapItem">QGraphicsPixmapItem</a></b> ( QGraphicsItem * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#QGraphicsPixmapItem-2">QGraphicsPixmapItem</a></b> ( const QPixmap &amp; <i>pixmap</i>, QGraphicsItem * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#dtor.QGraphicsPixmapItem">~QGraphicsPixmapItem</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QPointF </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#offset">offset</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QPixmap </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#pixmap">pixmap</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#setOffset">setOffset</a></b> ( const QPointF &amp; <i>offset</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#setOffset-2">setOffset</a></b> ( qreal <i>x</i>, qreal <i>y</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#setPixmap">setPixmap</a></b> ( const QPixmap &amp; <i>pixmap</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#setShapeMode">setShapeMode</a></b> ( ShapeMode <i>mode</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#setTransformationMode">setTransformationMode</a></b> ( Qt::TransformationMode <i>mode</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">ShapeMode </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#shapeMode">shapeMode</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Qt::TransformationMode </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#transformationMode">transformationMode</a></b> () const</td></tr>
</table>
<hr />
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual QRectF </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#boundingRect">boundingRect</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#contains">contains</a></b> ( const QPointF &amp; <i>point</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#isObscuredBy">isObscuredBy</a></b> ( const QGraphicsItem * <i>item</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QPainterPath </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#opaqueArea">opaqueArea</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#paint">paint</a></b> ( QPainter * <i>painter</i>, const QStyleOptionGraphicsItem * <i>option</i>, QWidget * <i>widget</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QPainterPath </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#shape">shape</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicspixmapitem.html#type">type</a></b> () const</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>177 public functions inherited from <a href="qgraphicsitem.html#public-functions">QGraphicsItem</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>2 static public members inherited from <a href="qgraphicsitem.html#static-public-members">QGraphicsItem</a></li>
<li><div class="fn"></div>23 protected functions inherited from <a href="qgraphicsitem.html#protected-functions">QGraphicsItem</a></li>
</ul>
<a name="details"></a>
<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>Member Type Documentation</h2>
<a name="//apple_ref/cpp/tag/QGraphicsPixmapItem/ShapeMode"></a>
<a name="//apple_ref/cpp/econst/QGraphicsPixmapItem/MaskShape"></a>
<a name="//apple_ref/cpp/econst/QGraphicsPixmapItem/BoundingRectShape"></a>
<a name="//apple_ref/cpp/econst/QGraphicsPixmapItem/HeuristicMaskShape"></a>
<h3 class="fn"><a name="ShapeMode-enum"></a>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 class="valuelist" border="1" cellpadding="2" cellspacing="1" 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>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/QGraphicsPixmapItem"></a>
<h3 class="fn"><a name="QGraphicsPixmapItem"></a>QGraphicsPixmapItem::QGraphicsPixmapItem ( <a href="qgraphicsitem.html">QGraphicsItem</a> * <i>parent</i> = 0 )</h3>
<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"></a>QGraphicsPixmapItem::QGraphicsPixmapItem ( const <a href="qpixmap.html">QPixmap</a> &amp; <i>pixmap</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> * <i>parent</i> = 0 )</h3>
<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"></a>
<h3 class="fn"><a name="dtor.QGraphicsPixmapItem"></a>QGraphicsPixmapItem::~QGraphicsPixmapItem ()</h3>
<p>Destroys the <a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/boundingRect"></a>
<h3 class="fn"><a name="boundingRect"></a><a href="qrectf.html">QRectF</a> QGraphicsPixmapItem::boundingRect () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#boundingRect">QGraphicsItem::boundingRect</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/contains"></a>
<h3 class="fn"><a name="contains"></a>bool QGraphicsPixmapItem::contains ( const <a href="qpointf.html">QPointF</a> &amp; <i>point</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#contains">QGraphicsItem::contains</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/isObscuredBy"></a>
<h3 class="fn"><a name="isObscuredBy"></a>bool QGraphicsPixmapItem::isObscuredBy ( const <a href="qgraphicsitem.html">QGraphicsItem</a> * <i>item</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#isObscuredBy">QGraphicsItem::isObscuredBy</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/offset"></a>
<h3 class="fn"><a name="offset"></a><a href="qpointf.html">QPointF</a> QGraphicsPixmapItem::offset () const</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"></a>
<h3 class="fn"><a name="opaqueArea"></a><a href="qpainterpath.html">QPainterPath</a> QGraphicsPixmapItem::opaqueArea () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#opaqueArea">QGraphicsItem::opaqueArea</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/paint"></a>
<h3 class="fn"><a name="paint"></a>void QGraphicsPixmapItem::paint ( <a href="qpainter.html">QPainter</a> * <i>painter</i>, const <a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a> * <i>option</i>, <a href="qwidget.html">QWidget</a> * <i>widget</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#paint">QGraphicsItem::paint</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/pixmap"></a>
<h3 class="fn"><a name="pixmap"></a><a href="qpixmap.html">QPixmap</a> QGraphicsPixmapItem::pixmap () const</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"></a>
<h3 class="fn"><a name="setOffset"></a>void QGraphicsPixmapItem::setOffset ( const <a href="qpointf.html">QPointF</a> &amp; <i>offset</i> )</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"></a>void QGraphicsPixmapItem::setOffset ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>x</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>y</i> )</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"></a>
<h3 class="fn"><a name="setPixmap"></a>void QGraphicsPixmapItem::setPixmap ( const <a href="qpixmap.html">QPixmap</a> &amp; <i>pixmap</i> )</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"></a>
<h3 class="fn"><a name="setShapeMode"></a>void QGraphicsPixmapItem::setShapeMode ( <a href="qgraphicspixmapitem.html#ShapeMode-enum">ShapeMode</a> <i>mode</i> )</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"></a>
<h3 class="fn"><a name="setTransformationMode"></a>void QGraphicsPixmapItem::setTransformationMode ( <a href="qt.html#TransformationMode-enum">Qt::TransformationMode</a> <i>mode</i> )</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"></a>
<h3 class="fn"><a name="shape"></a><a href="qpainterpath.html">QPainterPath</a> QGraphicsPixmapItem::shape () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#shape">QGraphicsItem::shape</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsPixmapItem/shapeMode"></a>
<h3 class="fn"><a name="shapeMode"></a><a href="qgraphicspixmapitem.html#ShapeMode-enum">ShapeMode</a> QGraphicsPixmapItem::shapeMode () const</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"></a>
<h3 class="fn"><a name="transformationMode"></a><a href="qt.html#TransformationMode-enum">Qt::TransformationMode</a> QGraphicsPixmapItem::transformationMode () const</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"></a>
<h3 class="fn"><a name="type"></a>int QGraphicsPixmapItem::type () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#type">QGraphicsItem::type</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.3</div></td>
</tr></table></div></address></body>
</html>