Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 5393

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qgraphicseffect.cpp -->
  <title>Qt 4.8: QGraphicsEffect Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QGraphicsEffect</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QGraphicsEffect Class Reference</h1>
<!-- $$$QGraphicsEffect-brief -->
<p>The QGraphicsEffect class is the base class for all graphics effects. <a href="#details">More...</a></p>
<!-- @@@QGraphicsEffect -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QGraphicsEffect&gt;</span></pre><p><b>Inherits: </b><a href="qobject.html">QObject</a>.</p>
<p><b>Inherited by: </b><a href="qgraphicsblureffect.html">QGraphicsBlurEffect</a>, <a href="qgraphicscolorizeeffect.html">QGraphicsColorizeEffect</a>, <a href="qgraphicsdropshadoweffect.html">QGraphicsDropShadowEffect</a>, and <a href="qgraphicsopacityeffect.html">QGraphicsOpacityEffect</a>.</p>
<p>This class was introduced in Qt 4.6.</p>
<ul>
<li><a href="qgraphicseffect-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qgraphicseffect.html#ChangeFlag-enum">ChangeFlag</a></b> { SourceAttached, SourceDetached, SourceBoundingRectChanged, SourceInvalidated }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qgraphicseffect.html#ChangeFlag-enum">ChangeFlags</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qgraphicseffect.html#PixmapPadMode-enum">PixmapPadMode</a></b> { NoPad, PadToTransparentBorder, PadToEffectiveBoundingRect }</td></tr>
</table>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><a href="qgraphicseffect.html#enabled-prop">enabled</a></b> : bool</li>
</ul>
<ul>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qgraphicseffect.html#QGraphicsEffect">QGraphicsEffect</a></b> ( QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qgraphicseffect.html#dtor.QGraphicsEffect">~QGraphicsEffect</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicseffect.html#boundingRect">boundingRect</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicseffect.html#boundingRectFor">boundingRectFor</a></b> ( const QRectF &amp; <i>rect</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicseffect.html#enabled-prop">isEnabled</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicseffect.html#enabled-prop">setEnabled</a></b> ( bool <i>enable</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicseffect.html#update">update</a></b> ()</td></tr>
</table>
<ul>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicseffect.html#enabledChanged">enabledChanged</a></b> ( bool <i>enabled</i> )</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicseffect.html#draw">draw</a></b> ( QPainter * <i>painter</i> ) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicseffect.html#drawSource">drawSource</a></b> ( QPainter * <i>painter</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicseffect.html#sourceBoundingRect">sourceBoundingRect</a></b> ( Qt::CoordinateSystem <i>system</i> = Qt::LogicalCoordinates ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicseffect.html#sourceChanged">sourceChanged</a></b> ( ChangeFlags <i>flags</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicseffect.html#sourceIsPixmap">sourceIsPixmap</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPixmap </td><td class="memItemRight bottomAlign"><b><a href="qgraphicseffect.html#sourcePixmap">sourcePixmap</a></b> ( Qt::CoordinateSystem <i>system</i> = Qt::LogicalCoordinates, QPoint * <i>offset</i> = 0, PixmapPadMode <i>mode</i> = PadToEffectiveBoundingRect ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicseffect.html#updateBoundingRect">updateBoundingRect</a></b> ()</td></tr>
</table>
<ul>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QGraphicsEffect-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QGraphicsEffect class is the base class for all graphics effects.</p>
<p>Effects alter the appearance of elements by hooking into the rendering pipeline and operating between the source (e.g&#x2e;, a <a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a>) and the destination device (e.g&#x2e;, <a href="qgraphicsview.html">QGraphicsView</a>'s viewport). Effects can be disabled by calling setEnabled(false). If effects are disabled, the source is rendered directly.</p>
<p>To add a visual effect to a <a href="qgraphicsitem.html">QGraphicsItem</a>, for example, you can use one of the standard effects, or alternately, create your own effect by creating a subclass of QGraphicsEffect. The effect can then be installed on the item using <a href="qgraphicsitem.html#setGraphicsEffect">QGraphicsItem::setGraphicsEffect</a>().</p>
<p>Qt provides the following standard effects:</p>
<ul>
<li><a href="qgraphicsblureffect.html">QGraphicsBlurEffect</a> - blurs the item by a given radius</li>
<li><a href="qgraphicsdropshadoweffect.html">QGraphicsDropShadowEffect</a> - renders a dropshadow behind the item</li>
<li><a href="qgraphicscolorizeeffect.html">QGraphicsColorizeEffect</a> - renders the item in shades of any given color</li>
<li><a href="qgraphicsopacityeffect.html">QGraphicsOpacityEffect</a> - renders the item with an opacity</li>
</ul>
<table class="generic">
<tr valign="top" class="odd"><td  colspan="2"><p class="centerAlign"><img src="images/graphicseffect-plain.png" alt="" /></p></td></tr>
<tr valign="top" class="even"><td ><p class="centerAlign"><img src="images/graphicseffect-blur.png" alt="" /></p></td><td ><p class="centerAlign"><img src="images/graphicseffect-colorize.png" alt="" /></p></td></tr>
<tr valign="top" class="odd"><td ><p class="centerAlign"><img src="images/graphicseffect-opacity.png" alt="" /></p></td><td ><p class="centerAlign"><img src="images/graphicseffect-drop-shadow.png" alt="" /></p></td></tr>
</table>
<p class="centerAlign"><img src="images/graphicseffect-widget.png" alt="" /></p><p>For more information on how to use each effect, refer to the specific effect's documentation.</p>
<p>To create your own custom effect, create a subclass of QGraphicsEffect (or any other existing effects) and reimplement the virtual function <a href="qgraphicseffect.html#draw">draw</a>(). This function is called whenever the effect needs to redraw. The <a href="qgraphicseffect.html#draw">draw</a>() function takes the painter with which to draw as an argument. For more information, refer to the documenation for <a href="qgraphicseffect.html#draw">draw</a>(). In the <a href="qgraphicseffect.html#draw">draw</a>() function you can call <a href="qgraphicseffect.html#sourcePixmap">sourcePixmap</a>() to get a pixmap of the graphics effect source which you can then process.</p>
<p>If your effect changes, use <a href="qgraphicseffect.html#update">update</a>() to request for a redraw. If your custom effect changes the bounding rectangle of the source, e.g&#x2e;, a radial glow effect may need to apply an extra margin, you can reimplement the virtual <a href="qgraphicseffect.html#boundingRectFor">boundingRectFor</a>() function, and call <a href="qgraphicseffect.html#updateBoundingRect">updateBoundingRect</a>() to notify the framework whenever this rectangle changes. The virtual <a href="qgraphicseffect.html#sourceChanged">sourceChanged</a>() function is called to notify the effects that the source has changed in some way - e.g&#x2e;, if the source is a <a href="qgraphicsrectitem.html">QGraphicsRectItem</a> and its rectangle parameters have changed.</p>
</div>
<p><b>See also </b><a href="qgraphicsitem.html#setGraphicsEffect">QGraphicsItem::setGraphicsEffect</a>() and <a href="qwidget.html#setGraphicsEffect">QWidget::setGraphicsEffect</a>().</p>
<!-- @@@QGraphicsEffect -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$ChangeFlag$$$SourceAttached$$$SourceDetached$$$SourceBoundingRectChanged$$$SourceInvalidated -->
<h3 class="flags"><a name="ChangeFlag-enum"></a>enum QGraphicsEffect::<span class="name">ChangeFlag</span><br/>flags QGraphicsEffect::<span class="name">ChangeFlags</span></h3>
<p>This enum describes what has changed in QGraphicsEffectSource.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QGraphicsEffect::SourceAttached</tt></td><td class="topAlign"><tt>0x1</tt></td><td class="topAlign">The effect is installed on a source.</td></tr>
<tr><td class="topAlign"><tt>QGraphicsEffect::SourceDetached</tt></td><td class="topAlign"><tt>0x2</tt></td><td class="topAlign">The effect is uninstalled on a source.</td></tr>
<tr><td class="topAlign"><tt>QGraphicsEffect::SourceBoundingRectChanged</tt></td><td class="topAlign"><tt>0x4</tt></td><td class="topAlign">The bounding rect of the source has changed.</td></tr>
<tr><td class="topAlign"><tt>QGraphicsEffect::SourceInvalidated</tt></td><td class="topAlign"><tt>0x8</tt></td><td class="topAlign">The visual appearance of the source has changed.</td></tr>
</table>
<p>The ChangeFlags type is a typedef for <a href="qflags.html">QFlags</a>&lt;ChangeFlag&gt;. It stores an OR combination of ChangeFlag values.</p>
<!-- @@@ChangeFlag -->
<!-- $$$PixmapPadMode$$$NoPad$$$PadToTransparentBorder$$$PadToEffectiveBoundingRect -->
<h3 class="fn"><a name="PixmapPadMode-enum"></a>enum QGraphicsEffect::<span class="name">PixmapPadMode</span></h3>
<p>This enum describes how the pixmap returned from sourcePixmap should be padded.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QGraphicsEffect::NoPad</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">The pixmap should not receive any additional padding.</td></tr>
<tr><td class="topAlign"><tt>QGraphicsEffect::PadToTransparentBorder</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">The pixmap should be padded to ensure it has a completely transparent border.</td></tr>
<tr><td class="topAlign"><tt>QGraphicsEffect::PadToEffectiveBoundingRect</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">The pixmap should be padded to match the effective bounding rectangle of the effect.</td></tr>
</table>
<!-- @@@PixmapPadMode -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$enabled-prop$$$isEnabled$$$setEnabledbool$$$enabledChangedbool -->
<h3 class="fn"><a name="enabled-prop"></a><span class="name">enabled</span> : <span class="type">bool</span></h3>
<p>This property holds whether the effect is enabled or not.</p>
<p>If an effect is disabled, the source will be rendered with as normal, with no interference from the effect. If the effect is enabled, the source will be rendered with the effect applied.</p>
<p>This property is enabled by default.</p>
<p>Using this property, you can disable certain effects on slow platforms, in order to ensure that the user interface is responsive.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isEnabled</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setEnabled</b></span> ( bool <i>enable</i> )</td></tr>
</table>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qgraphicseffect.html#enabledChanged">enabledChanged</a></b></span> ( bool <i>enabled</i> )</td></tr>
</table>
<!-- @@@enabled -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QGraphicsEffect[overload1]$$$QGraphicsEffectQObject* -->
<h3 class="fn"><a name="QGraphicsEffect"></a>QGraphicsEffect::<span class="name">QGraphicsEffect</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs a new <a href="qgraphicseffect.html">QGraphicsEffect</a> instance having the specified <i>parent</i>.</p>
<!-- @@@QGraphicsEffect -->
<!-- $$$~QGraphicsEffect[overload1]$$$~QGraphicsEffect -->
<h3 class="fn"><a name="dtor.QGraphicsEffect"></a>QGraphicsEffect::<span class="name">~QGraphicsEffect</span> ()<tt> [virtual]</tt></h3>
<p>Removes the effect from the source, and destroys the graphics effect.</p>
<!-- @@@~QGraphicsEffect -->
<!-- $$$boundingRect[overload1]$$$boundingRect -->
<h3 class="fn"><a name="boundingRect"></a><span class="type"><a href="qrectf.html">QRectF</a></span> QGraphicsEffect::<span class="name">boundingRect</span> () const</h3>
<p>Returns the effective bounding rectangle for this effect, i.e&#x2e;, the bounding rectangle of the source in device coordinates, adjusted by any margins applied by the effect itself.</p>
<p><b>See also </b><a href="qgraphicseffect.html#boundingRectFor">boundingRectFor</a>() and <a href="qgraphicseffect.html#updateBoundingRect">updateBoundingRect</a>().</p>
<!-- @@@boundingRect -->
<!-- $$$boundingRectFor[overload1]$$$boundingRectForconstQRectF& -->
<h3 class="fn"><a name="boundingRectFor"></a><span class="type"><a href="qrectf.html">QRectF</a></span> QGraphicsEffect::<span class="name">boundingRectFor</span> ( const <span class="type"><a href="qrectf.html">QRectF</a></span> &amp; <i>rect</i> ) const<tt> [virtual]</tt></h3>
<p>Returns the effective bounding rectangle for this effect, given the provided <i>rect</i> in the device coordinates. When writing you own custom effect, you must call <a href="qgraphicseffect.html#updateBoundingRect">updateBoundingRect</a>() whenever any parameters are changed that may cause this this function to return a different value.</p>
<p><b>See also </b><a href="qgraphicseffect.html#sourceBoundingRect">sourceBoundingRect</a>().</p>
<!-- @@@boundingRectFor -->
<!-- $$$draw[overload1]$$$drawQPainter* -->
<h3 class="fn"><a name="draw"></a><span class="type">void</span> QGraphicsEffect::<span class="name">draw</span> ( <span class="type"><a href="qpainter.html">QPainter</a></span> * <i>painter</i> )<tt> [pure virtual protected]</tt></h3>
<p>This pure virtual function draws the effect and is called whenever the source needs to be drawn.</p>
<p>Reimplement this function in a <a href="qgraphicseffect.html">QGraphicsEffect</a> subclass to provide the effect's drawing implementation, using <i>painter</i>.</p>
<p>For example:</p>
<pre class="cpp"> MyGraphicsEffect<span class="operator">::</span>draw(<span class="type"><a href="qpainter.html">QPainter</a></span> <span class="operator">*</span>painter)
 {
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
     <span class="type"><a href="qpoint.html">QPoint</a></span> offset;
     <span class="keyword">if</span> (sourceIsPixmap()) {
         <span class="comment">// No point in drawing in device coordinates (pixmap will be scaled anyways).</span>
         <span class="keyword">const</span> <span class="type"><a href="qpixmap.html">QPixmap</a></span> pixmap <span class="operator">=</span> sourcePixmap(<span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>LogicalCoordinates<span class="operator">,</span> <span class="operator">&amp;</span>offset);
         <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
         painter<span class="operator">-</span><span class="operator">&gt;</span>drawPixmap(offset<span class="operator">,</span> pixmap);
     } <span class="keyword">else</span> {
         <span class="comment">// Draw pixmap in device coordinates to avoid pixmap scaling;</span>
         <span class="keyword">const</span> <span class="type"><a href="qpixmap.html">QPixmap</a></span> pixmap <span class="operator">=</span> sourcePixmap(<span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>DeviceCoordinates<span class="operator">,</span> <span class="operator">&amp;</span>offset);
         painter<span class="operator">-</span><span class="operator">&gt;</span>setWorldTransform(<span class="type"><a href="qtransform.html">QTransform</a></span>());
         <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
         painter<span class="operator">-</span><span class="operator">&gt;</span>drawPixmap(offset<span class="operator">,</span> pixmap);
     }
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 }</pre>
<p>This function should not be called explicitly by the user, since it is meant for reimplementation purposes only.</p>
<!-- @@@draw -->
<!-- $$$drawSource[overload1]$$$drawSourceQPainter* -->
<h3 class="fn"><a name="drawSource"></a><span class="type">void</span> QGraphicsEffect::<span class="name">drawSource</span> ( <span class="type"><a href="qpainter.html">QPainter</a></span> * <i>painter</i> )<tt> [protected]</tt></h3>
<p>Draws the source directly using the given <i>painter</i>.</p>
<p>This function should only be called from <a href="qgraphicseffect.html#draw">QGraphicsEffect::draw</a>().</p>
<p>For example:</p>
<pre class="cpp"> MyGraphicsOpacityEffect<span class="operator">::</span><a href="qgraphicseffect.html#draw">draw</a>(<span class="type"><a href="qpainter.html">QPainter</a></span> <span class="operator">*</span>painter)
 {
     <span class="comment">// Fully opaque; draw directly without going through a pixmap.</span>
     <span class="keyword">if</span> (<a href="qvector3d.html#qFuzzyCompare">qFuzzyCompare</a>(m_opacity<span class="operator">,</span> <span class="number">1</span>)) {
         drawSource(painter);
         <span class="keyword">return</span>;
     }
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 }</pre>
<p><b>See also </b><a href="qgraphicseffect.html#draw">QGraphicsEffect::draw</a>().</p>
<!-- @@@drawSource -->
<!-- $$$enabledChanged[overload1]$$$enabledChangedbool -->
<h3 class="fn"><a name="enabledChanged"></a><span class="type">void</span> QGraphicsEffect::<span class="name">enabledChanged</span> ( <span class="type">bool</span> <i>enabled</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted whenever the effect is enabled or disabled. The <i>enabled</i> parameter holds the effects's new enabled state.</p>
<p><b>See also </b><a href="qgraphicseffect.html#enabled-prop">isEnabled</a>().</p>
<!-- @@@enabledChanged -->
<!-- $$$sourceBoundingRect[overload1]$$$sourceBoundingRectQt::CoordinateSystem -->
<h3 class="fn"><a name="sourceBoundingRect"></a><span class="type"><a href="qrectf.html">QRectF</a></span> QGraphicsEffect::<span class="name">sourceBoundingRect</span> ( <span class="type"><a href="qt.html#CoordinateSystem-enum">Qt::CoordinateSystem</a></span> <i>system</i> = Qt::LogicalCoordinates ) const<tt> [protected]</tt></h3>
<p>Returns the bounding rectangle of the source mapped to the given <i>system</i>.</p>
<p>Calling this function with <a href="qt.html#CoordinateSystem-enum">Qt::DeviceCoordinates</a> outside of <a href="qgraphicseffect.html#draw">QGraphicsEffect::draw</a>() will give undefined results, as there is no device context available.</p>
<p><b>See also </b><a href="qgraphicseffect.html#draw">draw</a>().</p>
<!-- @@@sourceBoundingRect -->
<!-- $$$sourceChanged[overload1]$$$sourceChangedChangeFlags -->
<h3 class="fn"><a name="sourceChanged"></a><span class="type">void</span> QGraphicsEffect::<span class="name">sourceChanged</span> ( <span class="type"><a href="qgraphicseffect.html#ChangeFlag-enum">ChangeFlags</a></span> <i>flags</i> )<tt> [virtual protected]</tt></h3>
<p>This virtual function is called by <a href="qgraphicseffect.html">QGraphicsEffect</a> to notify the effect that the source has changed. If the effect applies any cache, then this cache must be purged in order to reflect the new appearance of the source.</p>
<p>The <i>flags</i> describes what has changed.</p>
<!-- @@@sourceChanged -->
<!-- $$$sourceIsPixmap[overload1]$$$sourceIsPixmap -->
<h3 class="fn"><a name="sourceIsPixmap"></a><span class="type">bool</span> QGraphicsEffect::<span class="name">sourceIsPixmap</span> () const<tt> [protected]</tt></h3>
<p>Returns true if the source effectively is a pixmap, e.g&#x2e;, a <a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a>.</p>
<p>This function is useful for optimization purposes. For instance, there's no point in drawing the source in device coordinates to avoid pixmap scaling if this function returns true - the source pixmap will be scaled anyways.</p>
<!-- @@@sourceIsPixmap -->
<!-- $$$sourcePixmap[overload1]$$$sourcePixmapQt::CoordinateSystemQPoint*PixmapPadMode -->
<h3 class="fn"><a name="sourcePixmap"></a><span class="type"><a href="qpixmap.html">QPixmap</a></span> QGraphicsEffect::<span class="name">sourcePixmap</span> ( <span class="type"><a href="qt.html#CoordinateSystem-enum">Qt::CoordinateSystem</a></span> <i>system</i> = Qt::LogicalCoordinates, <span class="type"><a href="qpoint.html">QPoint</a></span> * <i>offset</i> = 0, <span class="type"><a href="qgraphicseffect.html#PixmapPadMode-enum">PixmapPadMode</a></span> <i>mode</i> = PadToEffectiveBoundingRect ) const<tt> [protected]</tt></h3>
<p>Returns a pixmap with the source painted into it.</p>
<p>The <i>system</i> specifies which coordinate system to be used for the source. The optional <i>offset</i> parameter returns the offset where the pixmap should be painted at using the current painter. For control on how the pixmap is padded use the <i>mode</i> parameter.</p>
<p>The returned pixmap is clipped to the current painter's device rectangle when <i>system</i> is <a href="qt.html#CoordinateSystem-enum">Qt::DeviceCoordinates</a>.</p>
<p>Calling this function with <a href="qt.html#CoordinateSystem-enum">Qt::DeviceCoordinates</a> outside of <a href="qgraphicseffect.html#draw">QGraphicsEffect::draw</a>() will give undefined results, as there is no device context available.</p>
<p><b>See also </b><a href="qgraphicseffect.html#draw">draw</a>() and <a href="qgraphicseffect.html#boundingRect">boundingRect</a>().</p>
<!-- @@@sourcePixmap -->
<!-- $$$update[overload1]$$$update -->
<h3 class="fn"><a name="update"></a><span class="type">void</span> QGraphicsEffect::<span class="name">update</span> ()<tt> [slot]</tt></h3>
<p>Schedules a redraw of the effect. Call this function whenever the effect needs to be redrawn. This function does not trigger a redraw of the source.</p>
<p><b>See also </b><a href="qgraphicseffect.html#updateBoundingRect">updateBoundingRect</a>().</p>
<!-- @@@update -->
<!-- $$$updateBoundingRect[overload1]$$$updateBoundingRect -->
<h3 class="fn"><a name="updateBoundingRect"></a><span class="type">void</span> QGraphicsEffect::<span class="name">updateBoundingRect</span> ()<tt> [protected]</tt></h3>
<p>This function notifies the effect framework when the effect's bounding rectangle has changed. As a custom effect author, you must call this function whenever you change any parameters that will cause the virtual <a href="qgraphicseffect.html#boundingRectFor">boundingRectFor</a>() function to return a different value.</p>
<p>This function will call <a href="qgraphicseffect.html#update">update</a>() if this is necessary.</p>
<p><b>See also </b><a href="qgraphicseffect.html#boundingRectFor">boundingRectFor</a>(), <a href="qgraphicseffect.html#boundingRect">boundingRect</a>(), and <a href="qgraphicseffect.html#sourceBoundingRect">sourceBoundingRect</a>().</p>
<!-- @@@updateBoundingRect -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Qt and respective logos are trademarks of The Qt Company Ltd 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>