Sophie

Sophie

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

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">
<!-- qgraphicssvgitem.cpp -->
<head>
  <title>Qt 4.6: QGraphicsSvgItem Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//QGraphicsSvgItem"></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">QGraphicsSvgItem Class Reference<br /><span class="small-subtitle">[<a href="qtsvg.html">QtSvg</a> module]</span>
</h1>
<p>The QGraphicsSvgItem class is a <a href="qgraphicsitem.html">QGraphicsItem</a> that can be used to render the contents of SVG files. <a href="#details">More...</a></p>
<pre> #include &lt;QGraphicsSvgItem&gt;</pre><p><b>This class is not part of the Qt GUI Framework Edition.</b></p>
<p>Inherits <a href="qgraphicsobject.html">QGraphicsObject</a>.</p>
<p>This class was introduced in Qt 4.2.</p>
<ul>
<li><a href="qgraphicssvgitem-members.html">List of all members, including inherited members</a></li>
<li><a href="qgraphicssvgitem-obsolete.html">Obsolete members</a></li>
</ul>
<hr />
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li><div class="fn"><b><a href="qgraphicssvgitem.html#elementId-prop">elementId</a></b> : QString</div></li>
<li><div class="fn"><b><a href="qgraphicssvgitem.html#maximumCacheSize-prop">maximumCacheSize</a></b> : QSize</div></li>
</ul>
<ul>
<li><div bar="2" class="fn"></div>11 properties inherited from <a href="qgraphicsobject.html#properties">QGraphicsObject</a></li>
<li><div bar="2" class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<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="qgraphicssvgitem.html#QGraphicsSvgItem">QGraphicsSvgItem</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="qgraphicssvgitem.html#QGraphicsSvgItem-2">QGraphicsSvgItem</a></b> ( const QString &amp; <i>fileName</i>, QGraphicsItem * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicssvgitem.html#elementId-prop">elementId</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QSize </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicssvgitem.html#maximumCacheSize-prop">maximumCacheSize</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QSvgRenderer * </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicssvgitem.html#renderer">renderer</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicssvgitem.html#elementId-prop">setElementId</a></b> ( const QString &amp; <i>id</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicssvgitem.html#maximumCacheSize-prop">setMaximumCacheSize</a></b> ( const QSize &amp; <i>size</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicssvgitem.html#setSharedRenderer">setSharedRenderer</a></b> ( QSvgRenderer * <i>renderer</i> )</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="qgraphicssvgitem.html#boundingRect">boundingRect</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicssvgitem.html#paint">paint</a></b> ( QPainter * <i>painter</i>, const QStyleOptionGraphicsItem * <i>option</i>, QWidget * <i>widget</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicssvgitem.html#type">type</a></b> () const</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>2 public functions inherited from <a href="qgraphicsobject.html#public-functions">QGraphicsObject</a></li>
<li><div bar="2" class="fn"></div>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<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>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li><div class="fn"></div>9 signals inherited from <a href="qgraphicsobject.html#signals">QGraphicsObject</a></li>
<li><div class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
<li><div class="fn"></div>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<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>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</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 QGraphicsSvgItem class is a <a href="qgraphicsitem.html">QGraphicsItem</a> that can be used to render the contents of SVG files.</p>
<p>QGraphicsSvgItem provides a way of rendering SVG files onto <a href="qgraphicsview.html">QGraphicsView</a>. QGraphicsSvgItem can be created by passing the SVG file to be rendered to its constructor or by explicit setting a shared <a href="qsvgrenderer.html">QSvgRenderer</a> on it.</p>
<p>Note that setting <a href="qsvgrenderer.html">QSvgRenderer</a> on a QGraphicsSvgItem doesn't make the item take ownership of the renderer, therefore if using <a href="qgraphicssvgitem.html#setSharedRenderer">setSharedRenderer</a>() method one has to make sure that the lifetime of the <a href="qsvgrenderer.html">QSvgRenderer</a> object will be at least as long as that of the QGraphicsSvgItem.</p>
<p>QGraphicsSvgItem provides a way of rendering only parts of the SVG files via the setElementId. If <a href="qgraphicssvgitem.html#elementId-prop">setElementId</a>() method is called, only the SVG element (and its children) with the passed id will be renderer. This provides a convenient way of selectively rendering large SVG files that contain a number of discrete elements. For example the following code renders only jokers from a SVG file containing a whole card deck:</p>
<pre> QSvgRenderer *renderer = new QSvgRenderer(QLatin1String(&quot;SvgCardDeck.svg&quot;));
 QGraphicsSvgItem *black = new QGraphicsSvgItem();
 QGraphicsSvgItem *red   = new QGraphicsSvgItem();

 black-&gt;setSharedRenderer(renderer);
 black-&gt;setElementId(QLatin1String(&quot;black_joker&quot;));

 red-&gt;setSharedRenderer(renderer);
 red-&gt;setElementId(QLatin1String(&quot;red_joker&quot;));</pre>
<p>Size of the item can be set via the setSize() method or via direct manipulation of the items transformation matrix.</p>
<p>By default the SVG rendering is cached using <a href="qgraphicsitem.html#CacheMode-enum">QGraphicsItem::DeviceCoordinateCache</a> mode to speedup the display of items. Caching can be disabled by passing <a href="qgraphicsitem.html#CacheMode-enum">QGraphicsItem::NoCache</a> to the <a href="qgraphicsitem.html#setCacheMode">QGraphicsItem::setCacheMode</a>() method.</p>
<p>See also <a href="qsvgwidget.html">QSvgWidget</a>, <a href="qtsvg.html">QtSvg Module</a>, <a href="qgraphicsitem.html">QGraphicsItem</a>, and <a href="qgraphicsview.html">QGraphicsView</a>.</p>
<hr />
<h2>Property Documentation</h2>
<a name="//apple_ref/cpp/instm/QGraphicsSvgItem/elementId"></a>
<a name="//apple_ref/cpp/instm/QGraphicsSvgItem/setElementId"></a>
<h3 class="fn"><a name="elementId-prop"></a>elementId : <a href="qstring.html">QString</a></h3>
<p>This property holds the element's XML ID.</p>
<p>This property was introduced in Qt 4.6.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b>elementId</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setElementId</b> ( const QString &amp; <i>id</i> )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/QGraphicsSvgItem/maximumCacheSize"></a>
<a name="//apple_ref/cpp/instm/QGraphicsSvgItem/setMaximumCacheSize"></a>
<h3 class="fn"><a name="maximumCacheSize-prop"></a>maximumCacheSize : <a href="qsize.html">QSize</a></h3>
<p>This property holds the maximum size of the device coordinate cache for this item.</p>
<p>This property was introduced in Qt 4.6.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QSize </td><td class="memItemRight" valign="bottom"><b>maximumCacheSize</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setMaximumCacheSize</b> ( const QSize &amp; <i>size</i> )</td></tr>
</table>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/QGraphicsSvgItem/QGraphicsSvgItem"></a>
<h3 class="fn"><a name="QGraphicsSvgItem"></a>QGraphicsSvgItem::QGraphicsSvgItem ( <a href="qgraphicsitem.html">QGraphicsItem</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a new SVG item with the given <i>parent</i>.</p>
<h3 class="fn"><a name="QGraphicsSvgItem-2"></a>QGraphicsSvgItem::QGraphicsSvgItem ( const <a href="qstring.html">QString</a> &amp; <i>fileName</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a new item with the given <i>parent</i> and loads the contents of the SVG file with the specified <i>fileName</i>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsSvgItem/boundingRect"></a>
<h3 class="fn"><a name="boundingRect"></a><a href="qrectf.html">QRectF</a> QGraphicsSvgItem::boundingRect () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#boundingRect">QGraphicsItem::boundingRect</a>().</p>
<p>Returns the bounding rectangle of this item.</p>
<a name="//apple_ref/cpp/instm/QGraphicsSvgItem/paint"></a>
<h3 class="fn"><a name="paint"></a>void QGraphicsSvgItem::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> = 0 )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#paint">QGraphicsItem::paint</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsSvgItem/renderer"></a>
<h3 class="fn"><a name="renderer"></a><a href="qsvgrenderer.html">QSvgRenderer</a> * QGraphicsSvgItem::renderer () const</h3>
<p>Returns the currently use <a href="qsvgrenderer.html">QSvgRenderer</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsSvgItem/setSharedRenderer"></a>
<h3 class="fn"><a name="setSharedRenderer"></a>void QGraphicsSvgItem::setSharedRenderer ( <a href="qsvgrenderer.html">QSvgRenderer</a> * <i>renderer</i> )</h3>
<p>Sets <i>renderer</i> to be a shared <a href="qsvgrenderer.html">QSvgRenderer</a> on the item. By using this method one can share the same <a href="qsvgrenderer.html">QSvgRenderer</a> on a number of items. This means that the SVG file will be parsed only once. <a href="qsvgrenderer.html">QSvgRenderer</a> passed to this method has to exist for as long as this item is used.</p>
<a name="//apple_ref/cpp/instm/QGraphicsSvgItem/type"></a>
<h3 class="fn"><a name="type"></a>int QGraphicsSvgItem::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>