Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 3321

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qgraphicsitem.cpp -->
  <title>QGraphicsItem Class | Qt Widgets 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QGraphicsItem</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<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="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#transformations">Transformations</a></li>
<li class="level2"><a href="#painting">Painting</a></li>
<li class="level2"><a href="#sorting">Sorting</a></li>
<li class="level2"><a href="#events">Events</a></li>
<li class="level2"><a href="#custom-data">Custom Data</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QGraphicsItem Class</h1>
<!-- $$$QGraphicsItem-brief -->
<p>The <a href="qgraphicsitem.html">QGraphicsItem</a> class is the base class for all graphical items in a <a href="qgraphicsscene.html">QGraphicsScene</a>. <a href="#details">More...</a></p>
<!-- @@@QGraphicsItem -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QGraphicsItem&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 4.2</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qabstractgraphicsshapeitem.html">QAbstractGraphicsShapeItem</a>, <a href="qgraphicsitemgroup.html">QGraphicsItemGroup</a>, <a href="qgraphicslineitem.html">QGraphicsLineItem</a>, <a href="qgraphicsobject.html">QGraphicsObject</a>, and <a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a></p>
</td></tr></table></div><ul>
<li><a href="qgraphicsitem-members.html">List of all members, including inherited members</a></li>
<li><a href="qgraphicsitem-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#CacheMode-enum">CacheMode</a></b> { NoCache, ItemCoordinateCache, DeviceCoordinateCache }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#GraphicsItemChange-enum">GraphicsItemChange</a></b> { ItemEnabledChange, ItemEnabledHasChanged, ItemMatrixChange, ItemPositionChange, ..., ItemScenePositionHasChanged }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#GraphicsItemFlag-enum">GraphicsItemFlag</a></b> { ItemIsMovable, ItemIsSelectable, ItemIsFocusable, ItemClipsToShape, ..., ItemContainsChildrenInShape }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#GraphicsItemFlag-enum">GraphicsItemFlags</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#PanelModality-enum">PanelModality</a></b> { NonModal, PanelModal, SceneModal }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></b>(QGraphicsItem *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#dtor.QGraphicsItem">~QGraphicsItem</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#acceptDrops">acceptDrops</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#acceptHoverEvents">acceptHoverEvents</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#acceptTouchEvents">acceptTouchEvents</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::MouseButtons </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#acceptedMouseButtons">acceptedMouseButtons</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#advance">advance</a></b>(int <i>phase</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#boundingRect">boundingRect</a></b>() const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRegion </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#boundingRegion">boundingRegion</a></b>(const QTransform &amp;<i>itemToDeviceTransform</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#boundingRegionGranularity">boundingRegionGranularity</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> CacheMode </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#cacheMode">cacheMode</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QGraphicsItem *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#childItems">childItems</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#childrenBoundingRect">childrenBoundingRect</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#clearFocus">clearFocus</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#clipPath">clipPath</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#collidesWithItem">collidesWithItem</a></b>(const QGraphicsItem *<i>other</i>, Qt::ItemSelectionMode <i>mode</i> = Qt::IntersectsItemShape) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#collidesWithPath">collidesWithPath</a></b>(const QPainterPath &amp;<i>path</i>, Qt::ItemSelectionMode <i>mode</i> = Qt::IntersectsItemShape) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QGraphicsItem *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#collidingItems">collidingItems</a></b>(Qt::ItemSelectionMode <i>mode</i> = Qt::IntersectsItemShape) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#commonAncestorItem">commonAncestorItem</a></b>(const QGraphicsItem *<i>other</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#contains">contains</a></b>(const QPointF &amp;<i>point</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCursor </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#cursor">cursor</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#data">data</a></b>(int <i>key</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTransform </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#deviceTransform">deviceTransform</a></b>(const QTransform &amp;<i>viewportTransform</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#effectiveOpacity">effectiveOpacity</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#ensureVisible">ensureVisible</a></b>(const QRectF &amp;<i>rect</i> = QRectF(), int <i>xmargin</i> = 50, int <i>ymargin</i> = 50)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#ensureVisible-1">ensureVisible</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>, int <i>xmargin</i> = 50, int <i>ymargin</i> = 50)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#filtersChildEvents">filtersChildEvents</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> GraphicsItemFlags </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#flags">flags</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#focusItem">focusItem</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#focusProxy">focusProxy</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#grabKeyboard">grabKeyboard</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#grabMouse">grabMouse</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsEffect *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#graphicsEffect">graphicsEffect</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsItemGroup *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#group">group</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#hasCursor">hasCursor</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#hasFocus">hasFocus</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#hide">hide</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::InputMethodHints </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#inputMethodHints">inputMethodHints</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#installSceneEventFilter">installSceneEventFilter</a></b>(QGraphicsItem *<i>filterItem</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#isActive">isActive</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#isAncestorOf">isAncestorOf</a></b>(const QGraphicsItem *<i>child</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#isBlockedByModalPanel">isBlockedByModalPanel</a></b>(QGraphicsItem **<i>blockingPanel</i> = Q_NULLPTR) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#isClipped">isClipped</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#isEnabled">isEnabled</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#isObscured">isObscured</a></b>(const QRectF &amp;<i>rect</i> = QRectF()) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#isObscured-1">isObscured</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#isObscuredBy">isObscuredBy</a></b>(const QGraphicsItem *<i>item</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#isPanel">isPanel</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#isSelected">isSelected</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#isUnderMouse">isUnderMouse</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#isVisible">isVisible</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#isVisibleTo">isVisibleTo</a></b>(const QGraphicsItem *<i>parent</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#isWidget">isWidget</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#isWindow">isWindow</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTransform </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#itemTransform">itemTransform</a></b>(const QGraphicsItem *<i>other</i>, bool *<i>ok</i> = Q_NULLPTR) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapFromItem">mapFromItem</a></b>(const QGraphicsItem *<i>item</i>, const QPointF &amp;<i>point</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapFromItem-1">mapFromItem</a></b>(const QGraphicsItem *<i>item</i>, const QRectF &amp;<i>rect</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapFromItem-2">mapFromItem</a></b>(const QGraphicsItem *<i>item</i>, const QPolygonF &amp;<i>polygon</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapFromItem-3">mapFromItem</a></b>(const QGraphicsItem *<i>item</i>, const QPainterPath &amp;<i>path</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapFromItem-4">mapFromItem</a></b>(const QGraphicsItem *<i>item</i>, qreal <i>x</i>, qreal <i>y</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapFromItem-5">mapFromItem</a></b>(const QGraphicsItem *<i>item</i>, qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapFromParent">mapFromParent</a></b>(const QPointF &amp;<i>point</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapFromParent-1">mapFromParent</a></b>(const QRectF &amp;<i>rect</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapFromParent-2">mapFromParent</a></b>(const QPolygonF &amp;<i>polygon</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapFromParent-3">mapFromParent</a></b>(const QPainterPath &amp;<i>path</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapFromParent-4">mapFromParent</a></b>(qreal <i>x</i>, qreal <i>y</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapFromParent-5">mapFromParent</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapFromScene">mapFromScene</a></b>(const QPointF &amp;<i>point</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapFromScene-1">mapFromScene</a></b>(const QRectF &amp;<i>rect</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapFromScene-2">mapFromScene</a></b>(const QPolygonF &amp;<i>polygon</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapFromScene-3">mapFromScene</a></b>(const QPainterPath &amp;<i>path</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapFromScene-4">mapFromScene</a></b>(qreal <i>x</i>, qreal <i>y</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapFromScene-5">mapFromScene</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapRectFromItem">mapRectFromItem</a></b>(const QGraphicsItem *<i>item</i>, const QRectF &amp;<i>rect</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapRectFromItem-1">mapRectFromItem</a></b>(const QGraphicsItem *<i>item</i>, qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapRectFromParent">mapRectFromParent</a></b>(const QRectF &amp;<i>rect</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapRectFromParent-1">mapRectFromParent</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapRectFromScene">mapRectFromScene</a></b>(const QRectF &amp;<i>rect</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapRectFromScene-1">mapRectFromScene</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapRectToItem">mapRectToItem</a></b>(const QGraphicsItem *<i>item</i>, const QRectF &amp;<i>rect</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapRectToItem-1">mapRectToItem</a></b>(const QGraphicsItem *<i>item</i>, qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapRectToParent">mapRectToParent</a></b>(const QRectF &amp;<i>rect</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapRectToParent-1">mapRectToParent</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapRectToScene">mapRectToScene</a></b>(const QRectF &amp;<i>rect</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapRectToScene-1">mapRectToScene</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapToItem">mapToItem</a></b>(const QGraphicsItem *<i>item</i>, const QPointF &amp;<i>point</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapToItem-1">mapToItem</a></b>(const QGraphicsItem *<i>item</i>, const QRectF &amp;<i>rect</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapToItem-2">mapToItem</a></b>(const QGraphicsItem *<i>item</i>, const QPolygonF &amp;<i>polygon</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapToItem-3">mapToItem</a></b>(const QGraphicsItem *<i>item</i>, const QPainterPath &amp;<i>path</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapToItem-4">mapToItem</a></b>(const QGraphicsItem *<i>item</i>, qreal <i>x</i>, qreal <i>y</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapToItem-5">mapToItem</a></b>(const QGraphicsItem *<i>item</i>, qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapToParent">mapToParent</a></b>(const QPointF &amp;<i>point</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapToParent-1">mapToParent</a></b>(const QRectF &amp;<i>rect</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapToParent-2">mapToParent</a></b>(const QPolygonF &amp;<i>polygon</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapToParent-3">mapToParent</a></b>(const QPainterPath &amp;<i>path</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapToParent-4">mapToParent</a></b>(qreal <i>x</i>, qreal <i>y</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapToParent-5">mapToParent</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapToScene">mapToScene</a></b>(const QPointF &amp;<i>point</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapToScene-1">mapToScene</a></b>(const QRectF &amp;<i>rect</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapToScene-2">mapToScene</a></b>(const QPolygonF &amp;<i>polygon</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapToScene-3">mapToScene</a></b>(const QPainterPath &amp;<i>path</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapToScene-4">mapToScene</a></b>(qreal <i>x</i>, qreal <i>y</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygonF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mapToScene-5">mapToScene</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#moveBy">moveBy</a></b>(qreal <i>dx</i>, qreal <i>dy</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#opacity">opacity</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#opaqueArea">opaqueArea</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#paint">paint</a></b>(QPainter *<i>painter</i>, const QStyleOptionGraphicsItem *<i>option</i>, QWidget *<i>widget</i> = Q_NULLPTR) = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#panel">panel</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> PanelModality </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#panelModality">panelModality</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#parentItem">parentItem</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsObject *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#parentObject">parentObject</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsWidget *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#parentWidget">parentWidget</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#pos">pos</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#removeSceneEventFilter">removeSceneEventFilter</a></b>(QGraphicsItem *<i>filterItem</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#resetTransform">resetTransform</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#rotation">rotation</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#scale">scale</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsScene *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#scene">scene</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#sceneBoundingRect">sceneBoundingRect</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#scenePos">scenePos</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTransform </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#sceneTransform">sceneTransform</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#scroll">scroll</a></b>(qreal <i>dx</i>, qreal <i>dy</i>, const QRectF &amp;<i>rect</i> = QRectF())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setAcceptDrops">setAcceptDrops</a></b>(bool <i>on</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setAcceptHoverEvents">setAcceptHoverEvents</a></b>(bool <i>enabled</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setAcceptTouchEvents">setAcceptTouchEvents</a></b>(bool <i>enabled</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setAcceptedMouseButtons">setAcceptedMouseButtons</a></b>(Qt::MouseButtons <i>buttons</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setActive">setActive</a></b>(bool <i>active</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setBoundingRegionGranularity">setBoundingRegionGranularity</a></b>(qreal <i>granularity</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setCacheMode">setCacheMode</a></b>(CacheMode <i>mode</i>, const QSize &amp;<i>logicalCacheSize</i> = QSize())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setCursor">setCursor</a></b>(const QCursor &amp;<i>cursor</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setData">setData</a></b>(int <i>key</i>, const QVariant &amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setEnabled">setEnabled</a></b>(bool <i>enabled</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setFiltersChildEvents">setFiltersChildEvents</a></b>(bool <i>enabled</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setFlag">setFlag</a></b>(GraphicsItemFlag <i>flag</i>, bool <i>enabled</i> = true)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setFlags">setFlags</a></b>(GraphicsItemFlags <i>flags</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setFocus">setFocus</a></b>(Qt::FocusReason <i>focusReason</i> = Qt::OtherFocusReason)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setFocusProxy">setFocusProxy</a></b>(QGraphicsItem *<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setGraphicsEffect">setGraphicsEffect</a></b>(QGraphicsEffect *<i>effect</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setGroup">setGroup</a></b>(QGraphicsItemGroup *<i>group</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setInputMethodHints">setInputMethodHints</a></b>(Qt::InputMethodHints <i>hints</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setOpacity">setOpacity</a></b>(qreal <i>opacity</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setPanelModality">setPanelModality</a></b>(PanelModality <i>panelModality</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setParentItem">setParentItem</a></b>(QGraphicsItem *<i>newParent</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setPos">setPos</a></b>(const QPointF &amp;<i>pos</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setPos-1">setPos</a></b>(qreal <i>x</i>, qreal <i>y</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setRotation">setRotation</a></b>(qreal <i>angle</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setScale">setScale</a></b>(qreal <i>factor</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setSelected">setSelected</a></b>(bool <i>selected</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setToolTip">setToolTip</a></b>(const QString &amp;<i>toolTip</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setTransform">setTransform</a></b>(const QTransform &amp;<i>matrix</i>, bool <i>combine</i> = false)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a></b>(const QPointF &amp;<i>origin</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setTransformOriginPoint-1">setTransformOriginPoint</a></b>(qreal <i>x</i>, qreal <i>y</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setTransformations">setTransformations</a></b>(const QList&lt;QGraphicsTransform *&gt; &amp;<i>transformations</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setVisible">setVisible</a></b>(bool <i>visible</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setX">setX</a></b>(qreal <i>x</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setY">setY</a></b>(qreal <i>y</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#setZValue">setZValue</a></b>(qreal <i>z</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#shape">shape</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#show">show</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#stackBefore">stackBefore</a></b>(const QGraphicsItem *<i>sibling</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsObject *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#toGraphicsObject">toGraphicsObject</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QGraphicsObject *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#toGraphicsObject-1">toGraphicsObject</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#toolTip">toolTip</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#topLevelItem">topLevelItem</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsWidget *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#topLevelWidget">topLevelWidget</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QTransform </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#transform">transform</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QGraphicsTransform *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#transformations">transformations</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#type">type</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#unsetCursor">unsetCursor</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#update">update</a></b>(const QRectF &amp;<i>rect</i> = QRectF())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#update-1">update</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>width</i>, qreal <i>height</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsWidget *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#window">window</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#x">x</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#y">y</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#zValue">zValue</a></b>() const</td></tr>
</table></div>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> const int </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#Type-var">Type</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const int </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#UserType-var">UserType</a></b></td></tr>
</table></div>
<a name="protected-functions"></a>
<h2 id="protected-functions">Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#contextMenuEvent">contextMenuEvent</a></b>(QGraphicsSceneContextMenuEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#dragEnterEvent">dragEnterEvent</a></b>(QGraphicsSceneDragDropEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#dragLeaveEvent">dragLeaveEvent</a></b>(QGraphicsSceneDragDropEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#dragMoveEvent">dragMoveEvent</a></b>(QGraphicsSceneDragDropEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#dropEvent">dropEvent</a></b>(QGraphicsSceneDragDropEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#focusInEvent">focusInEvent</a></b>(QFocusEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#focusOutEvent">focusOutEvent</a></b>(QFocusEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#hoverEnterEvent">hoverEnterEvent</a></b>(QGraphicsSceneHoverEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#hoverLeaveEvent">hoverLeaveEvent</a></b>(QGraphicsSceneHoverEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#hoverMoveEvent">hoverMoveEvent</a></b>(QGraphicsSceneHoverEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#inputMethodEvent">inputMethodEvent</a></b>(QInputMethodEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#inputMethodQuery">inputMethodQuery</a></b>(Qt::InputMethodQuery <i>query</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#itemChange">itemChange</a></b>(GraphicsItemChange <i>change</i>, const QVariant &amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#keyPressEvent">keyPressEvent</a></b>(QKeyEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#keyReleaseEvent">keyReleaseEvent</a></b>(QKeyEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a></b>(QGraphicsSceneMouseEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mouseMoveEvent">mouseMoveEvent</a></b>(QGraphicsSceneMouseEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a></b>(QGraphicsSceneMouseEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#mouseReleaseEvent">mouseReleaseEvent</a></b>(QGraphicsSceneMouseEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#prepareGeometryChange">prepareGeometryChange</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#sceneEvent">sceneEvent</a></b>(QEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#sceneEventFilter">sceneEventFilter</a></b>(QGraphicsItem *<i>watched</i>, QEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#updateMicroFocus">updateMicroFocus</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#wheelEvent">wheelEvent</a></b>(QGraphicsSceneWheelEvent *<i>event</i>)</td></tr>
</table></div>
<a name="related-non-members"></a>
<h2 id="related-non-members">Related Non-Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsitem.html#qgraphicsitem_cast">qgraphicsitem_cast</a></b>(QGraphicsItem *<i>item</i>)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QGraphicsItem-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qgraphicsitem.html">QGraphicsItem</a> class is the base class for all graphical items in a <a href="qgraphicsscene.html">QGraphicsScene</a>.</p>
<p>It provides a light-weight foundation for writing your own custom items. This includes defining the item's geometry, collision detection, its painting implementation and item interaction through its event handlers. <a href="qgraphicsitem.html">QGraphicsItem</a> is part of the <a href="graphicsview.html">Graphics View Framework</a></p>
<p class="centerAlign"><img src="images/graphicsview-items.png" alt="" /></p><p>For convenience, Qt provides a set of standard graphics items for the most common shapes. These are:</p>
<ul>
<li><a href="qgraphicsellipseitem.html">QGraphicsEllipseItem</a> provides an ellipse item</li>
<li><a href="qgraphicslineitem.html">QGraphicsLineItem</a> provides a line item</li>
<li><a href="qgraphicspathitem.html">QGraphicsPathItem</a> provides an arbitrary path item</li>
<li><a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a> provides a pixmap item</li>
<li><a href="qgraphicspolygonitem.html">QGraphicsPolygonItem</a> provides a polygon item</li>
<li><a href="qgraphicsrectitem.html">QGraphicsRectItem</a> provides a rectangular item</li>
<li><a href="qgraphicssimpletextitem.html">QGraphicsSimpleTextItem</a> provides a simple text label item</li>
<li><a href="qgraphicstextitem.html">QGraphicsTextItem</a> provides an advanced text browser item</li>
</ul>
<p>All of an item's geometric information is based on its local coordinate system. The item's position, <a href="qgraphicsitem.html#pos">pos</a>(), is the only function that does not operate in local coordinates, as it returns a position in parent coordinates. <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a> describes the coordinate system in detail.</p>
<p>You can set whether an item should be visible (i.e&#x2e;, drawn, and accepting events), by calling <a href="qgraphicsitem.html#setVisible">setVisible</a>(). Hiding an item will also hide its children. Similarly, you can enable or disable an item by calling <a href="qgraphicsitem.html#setEnabled">setEnabled</a>(). If you disable an item, all its children will also be disabled. By default, items are both visible and enabled. To toggle whether an item is selected or not, first enable selection by setting the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsSelectable</a> flag, and then call <a href="qgraphicsitem.html#setSelected">setSelected</a>(). Normally, selection is toggled by the scene, as a result of user interaction.</p>
<p>To write your own graphics item, you first create a subclass of <a href="qgraphicsitem.html">QGraphicsItem</a>, and then start by implementing its two pure virtual public functions: <a href="qgraphicsitem.html#boundingRect">boundingRect</a>(), which returns an estimate of the area painted by the item, and <a href="qgraphicsitem.html#paint">paint</a>(), which implements the actual painting. For example:</p>
<pre class="cpp">

  <span class="keyword">class</span> SimpleItem : <span class="keyword">public</span> <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span>
  {
  <span class="keyword">public</span>:
      <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> boundingRect() <span class="keyword">const</span>
      {
          <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> penWidth <span class="operator">=</span> <span class="number">1</span>;
          <span class="keyword">return</span> <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span>(<span class="operator">-</span><span class="number">10</span> <span class="operator">-</span> penWidth <span class="operator">/</span> <span class="number">2</span><span class="operator">,</span> <span class="operator">-</span><span class="number">10</span> <span class="operator">-</span> penWidth <span class="operator">/</span> <span class="number">2</span><span class="operator">,</span>
                        <span class="number">20</span> <span class="operator">+</span> penWidth<span class="operator">,</span> <span class="number">20</span> <span class="operator">+</span> penWidth);
      }

      <span class="type">void</span> paint(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> <span class="operator">*</span>painter<span class="operator">,</span> <span class="keyword">const</span> <span class="type"><a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a></span> <span class="operator">*</span>option<span class="operator">,</span>
                 <span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>widget)
      {
          painter<span class="operator">-</span><span class="operator">&gt;</span>drawRoundedRect(<span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">5</span><span class="operator">,</span> <span class="number">5</span>);
      }
  };

</pre>
<p>The <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() function has many different purposes. <a href="qgraphicsscene.html">QGraphicsScene</a> bases its item index on <a href="qgraphicsitem.html#boundingRect">boundingRect</a>(), and <a href="qgraphicsview.html">QGraphicsView</a> uses it both for culling invisible items, and for determining the area that needs to be recomposed when drawing overlapping items. In addition, <a href="qgraphicsitem.html">QGraphicsItem</a>'s collision detection mechanisms use <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() to provide an efficient cut-off. The fine grained collision algorithm in <a href="qgraphicsitem.html#collidesWithItem">collidesWithItem</a>() is based on calling <a href="qgraphicsitem.html#shape">shape</a>(), which returns an accurate outline of the item's shape as a <a href="../qtgui/qpainterpath.html">QPainterPath</a>.</p>
<p><a href="qgraphicsscene.html">QGraphicsScene</a> expects all items <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() and <a href="qgraphicsitem.html#shape">shape</a>() to remain unchanged unless it is notified. If you want to change an item's geometry in any way, you must first call <a href="qgraphicsitem.html#prepareGeometryChange">prepareGeometryChange</a>() to allow <a href="qgraphicsscene.html">QGraphicsScene</a> to update its bookkeeping.</p>
<p>Collision detection can be done in two ways:</p>
<ol class="1" type="1"><li>Reimplement <a href="qgraphicsitem.html#shape">shape</a>() to return an accurate shape for your item, and rely on the default implementation of <a href="qgraphicsitem.html#collidesWithItem">collidesWithItem</a>() to do shape-shape intersection. This can be rather expensive if the shapes are complex.</li>
<li>Reimplement <a href="qgraphicsitem.html#collidesWithItem">collidesWithItem</a>() to provide your own custom item and shape collision algorithm.</li>
</ol>
<p>The <a href="qgraphicsitem.html#contains">contains</a>() function can be called to determine whether the item <i>contains</i> a point or not. This function can also be reimplemented by the item. The default behavior of <a href="qgraphicsitem.html#contains">contains</a>() is based on calling <a href="qgraphicsitem.html#shape">shape</a>().</p>
<p>Items can contain other items, and also be contained by other items. All items can have a parent item and a list of children. Unless the item has no parent, its position is in <i>parent</i> coordinates (i.e&#x2e;, the parent's local coordinates). Parent items propagate both their position and their transformation to all children.</p>
<p class="centerAlign"><img src="images/graphicsview-parentchild.png" alt="" /></p><a name="transformations"></a><a name="transformations"></a>
<h3 >Transformations</h3>
<p><a href="qgraphicsitem.html">QGraphicsItem</a> supports projective transformations in addition to its base position, <a href="qgraphicsitem.html#pos">pos</a>(). There are several ways to change an item's transformation. For simple transformations, you can call either of the convenience functions <a href="qgraphicsitem.html#setRotation">setRotation</a>() or <a href="qgraphicsitem.html#setScale">setScale</a>(), or you can pass any transformation matrix to <a href="qgraphicsitem.html#setTransform">setTransform</a>(). For advanced transformation control you also have the option of setting several combined transformations by calling <a href="qgraphicsitem.html#setTransformations">setTransformations</a>().</p>
<p>Item transformations accumulate from parent to child, so if both a parent and child item are rotated 90 degrees, the child's total transformation will be 180 degrees. Similarly, if the item's parent is scaled to 2x its original size, its children will also be twice as large. An item's transformation does not affect its own local geometry; all geometry functions (e.g&#x2e;, <a href="qgraphicsitem.html#contains">contains</a>(), <a href="qgraphicsitem.html#update">update</a>(), and all the mapping functions) still operate in local coordinates. For convenience, <a href="qgraphicsitem.html">QGraphicsItem</a> provides the functions <a href="qgraphicsitem.html#sceneTransform">sceneTransform</a>(), which returns the item's total transformation matrix (including its position and all parents' positions and transformations), and <a href="qgraphicsitem.html#scenePos">scenePos</a>(), which returns its position in scene coordinates. To reset an item's matrix, call <a href="qgraphicsitem.html#resetTransform">resetTransform</a>().</p>
<p>Certain transformation operations produce a different outcome depending on the order in which they are applied. For example, if you scale an transform, and then rotate it, you may get a different result than if the transform was rotated first. However, the order you set the transformation properties on <a href="qgraphicsitem.html">QGraphicsItem</a> does not affect the resulting transformation; <a href="qgraphicsitem.html">QGraphicsItem</a> always applies the properties in a fixed, defined order:</p>
<ul>
<li>The item's base transform is applied (<a href="qgraphicsitem.html#transform">transform</a>())</li>
<li>The item's transformations list is applied in order (<a href="qgraphicsitem.html#transformations">transformations</a>())</li>
<li>The item is rotated relative to its transform origin point (<a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a>())</li>
<li>The item is scaled relative to its transform origin point (<a href="qgraphicsitem.html#scale">scale</a>(), <a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a>())</li>
</ul>
<a name="painting"></a>
<h3 >Painting</h3>
<p>The <a href="qgraphicsitem.html#paint">paint</a>() function is called by <a href="qgraphicsview.html">QGraphicsView</a> to paint the item's contents. The item has no background or default fill of its own; whatever is behind the item will shine through all areas that are not explicitly painted in this function. You can call <a href="qgraphicsitem.html#update">update</a>() to schedule a repaint, optionally passing the rectangle that needs a repaint. Depending on whether or not the item is visible in a view, the item may or may not be repainted; there is no equivalent to <a href="qwidget.html#repaint">QWidget::repaint</a>() in <a href="qgraphicsitem.html">QGraphicsItem</a>.</p>
<p>Items are painted by the view, starting with the parent items and then drawing children, in ascending stacking order. You can set an item's stacking order by calling <a href="qgraphicsitem.html#setZValue">setZValue</a>(), and test it by calling <a href="qgraphicsitem.html#zValue">zValue</a>(), where items with low z-values are painted before items with high z-values. Stacking order applies to sibling items; parents are always drawn before their children.</p>
<a name="sorting"></a>
<h3 >Sorting</h3>
<p>All items are drawn in a defined, stable order, and this same order decides which items will receive mouse input first when you click on the scene. Normally you don't have to worry about sorting, as the items follow a &quot;natural order&quot;, following the logical structure of the scene.</p>
<p>An item's children are stacked on top of the parent, and sibling items are stacked by insertion order (i.e&#x2e;, in the same order that they were either added to the scene, or added to the same parent). If you add item A, and then B, then B will be on top of A. If you then add C, the items' stacking order will be A, then B, then C.</p>
<p class="centerAlign"><img src="images/graphicsview-zorder.png" alt="" /></p><p>This example shows the stacking order of all limbs of the robot from the <a href="qtwidgets-graphicsview-dragdroprobot-example.html">Drag and Drop Robot</a> example. The torso is the root item (all other items are children or descendants of the torso), so it is drawn first. Next, the head is drawn, as it is the first item in the torso's list of children. Then the upper left arm is drawn. As the lower arm is a child of the upper arm, the lower arm is then drawn, followed by the upper arm's next sibling, which is the upper right arm, and so on.</p>
<p>For advanced users, there are ways to alter how your items are sorted:</p>
<ul>
<li>You can call <a href="qgraphicsitem.html#setZValue">setZValue</a>() on an item to explicitly stack it on top of, or under, other sibling items. The default Z value for an item is 0. Items with the same Z value are stacked by insertion order.</li>
<li>You can call <a href="qgraphicsitem.html#stackBefore">stackBefore</a>() to reorder the list of children. This will directly modify the insertion order.</li>
<li>You can set the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemStacksBehindParent</a> flag to stack a child item behind its parent.</li>
</ul>
<p>The stacking order of two sibling items also counts for each item's children and descendant items. So if one item is on top of another, then all its children will also be on top of all the other item's children as well.</p>
<a name="events"></a>
<h3 >Events</h3>
<p><a href="qgraphicsitem.html">QGraphicsItem</a> receives events from <a href="qgraphicsscene.html">QGraphicsScene</a> through the virtual function <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>(). This function distributes the most common events to a set of convenience event handlers:</p>
<ul>
<li><a href="qgraphicsitem.html#contextMenuEvent">contextMenuEvent</a>() handles context menu events</li>
<li><a href="qgraphicsitem.html#focusInEvent">focusInEvent</a>() and <a href="qgraphicsitem.html#focusOutEvent">focusOutEvent</a>() handle focus in and out events</li>
<li><a href="qgraphicsitem.html#hoverEnterEvent">hoverEnterEvent</a>(), <a href="qgraphicsitem.html#hoverMoveEvent">hoverMoveEvent</a>(), and <a href="qgraphicsitem.html#hoverLeaveEvent">hoverLeaveEvent</a>() handles hover enter, move and leave events</li>
<li><a href="qgraphicsitem.html#inputMethodEvent">inputMethodEvent</a>() handles input events, for accessibility support</li>
<li><a href="qgraphicsitem.html#keyPressEvent">keyPressEvent</a>() and <a href="qgraphicsitem.html#keyReleaseEvent">keyReleaseEvent</a>() handle key press and release events</li>
<li><a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>(), <a href="qgraphicsitem.html#mouseMoveEvent">mouseMoveEvent</a>(), <a href="qgraphicsitem.html#mouseReleaseEvent">mouseReleaseEvent</a>(), and <a href="qgraphicsitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a>() handles mouse press, move, release, click and doubleclick events</li>
</ul>
<p>You can filter events for any other item by installing event filters. This functionality is separate from Qt's regular event filters (see <a href="../qtcore/qobject.html#installEventFilter">QObject::installEventFilter</a>()), which only work on subclasses of <a href="../qtcore/qobject.html">QObject</a>. After installing your item as an event filter for another item by calling <a href="qgraphicsitem.html#installSceneEventFilter">installSceneEventFilter</a>(), the filtered events will be received by the virtual function <a href="qgraphicsitem.html#sceneEventFilter">sceneEventFilter</a>(). You can remove item event filters by calling <a href="qgraphicsitem.html#removeSceneEventFilter">removeSceneEventFilter</a>().</p>
<a name="custom-data"></a>
<h3 >Custom Data</h3>
<p>Sometimes it's useful to register custom data with an item, be it a custom item, or a standard item. You can call <a href="qgraphicsitem.html#setData">setData</a>() on any item to store data in it using a key-value pair (the key being an integer, and the value is a <a href="../qtcore/qvariant.html">QVariant</a>). To get custom data from an item, call <a href="qgraphicsitem.html#data">data</a>(). This functionality is completely untouched by Qt itself; it is provided for the user's convenience.</p>
</div>
<p><b>See also </b><a href="qgraphicsscene.html">QGraphicsScene</a>, <a href="qgraphicsview.html">QGraphicsView</a>, and <a href="graphicsview.html">Graphics View Framework</a>.</p>
<!-- @@@QGraphicsItem -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$CacheMode$$$NoCache$$$ItemCoordinateCache$$$DeviceCoordinateCache -->
<h3 class="fn" id="CacheMode-enum"><a name="CacheMode-enum"></a>enum QGraphicsItem::<span class="name">CacheMode</span></h3>
<p>This enum describes <a href="qgraphicsitem.html">QGraphicsItem</a>'s cache modes. Caching is used to speed up rendering by allocating and rendering to an off-screen pixel buffer, which can be reused when the item requires redrawing. For some paint devices, the cache is stored directly in graphics memory, which makes rendering very quick.</p>
<div class="table"><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"><code>QGraphicsItem::NoCache</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The default; all item caching is disabled. <a href="qgraphicsitem.html#paint">QGraphicsItem::paint</a>() is called every time the item needs redrawing.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemCoordinateCache</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">Caching is enabled for the item's logical (local) coordinate system. <a href="qgraphicsitem.html">QGraphicsItem</a> creates an off-screen pixel buffer with a configurable size / resolution that you can pass to <a href="qgraphicsitem.html#setCacheMode">QGraphicsItem::setCacheMode</a>(). Rendering quality will typically degrade, depending on the resolution of the cache and the item transformation. The first time the item is redrawn, it will render itself into the cache, and the cache is then reused for every subsequent expose. The cache is also reused as the item is transformed. To adjust the resolution of the cache, you can call <a href="qgraphicsitem.html#setCacheMode">setCacheMode</a>() again.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::DeviceCoordinateCache</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">Caching is enabled at the paint device level, in device coordinates. This mode is for items that can move, but are not rotated, scaled or sheared. If the item is transformed directly or indirectly, the cache will be regenerated automatically. Unlike ItemCoordinateCacheMode, DeviceCoordinateCache always renders at maximum quality.</td></tr>
</table></div>
<p>This enum was introduced or modified in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setCacheMode">QGraphicsItem::setCacheMode</a>().</p>
<!-- @@@CacheMode -->
<!-- $$$GraphicsItemChange$$$ItemPositionChange$$$ItemMatrixChange$$$ItemVisibleChange$$$ItemEnabledChange$$$ItemSelectedChange$$$ItemParentChange$$$ItemChildAddedChange$$$ItemChildRemovedChange$$$ItemTransformChange$$$ItemPositionHasChanged$$$ItemTransformHasChanged$$$ItemSceneChange$$$ItemVisibleHasChanged$$$ItemEnabledHasChanged$$$ItemSelectedHasChanged$$$ItemParentHasChanged$$$ItemSceneHasChanged$$$ItemCursorChange$$$ItemCursorHasChanged$$$ItemToolTipChange$$$ItemToolTipHasChanged$$$ItemFlagsChange$$$ItemFlagsHaveChanged$$$ItemZValueChange$$$ItemZValueHasChanged$$$ItemOpacityChange$$$ItemOpacityHasChanged$$$ItemScenePositionHasChanged$$$ItemRotationChange$$$ItemRotationHasChanged$$$ItemScaleChange$$$ItemScaleHasChanged$$$ItemTransformOriginPointChange$$$ItemTransformOriginPointHasChanged -->
<h3 class="fn" id="GraphicsItemChange-enum"><a name="GraphicsItemChange-enum"></a>enum QGraphicsItem::<span class="name">GraphicsItemChange</span></h3>
<p>This enum describes the state changes that are notified by <a href="qgraphicsitem.html#itemChange">QGraphicsItem::itemChange</a>(). The notifications are sent as the state changes, and in some cases, adjustments can be made (see the documentation for each change for details).</p>
<p>Note: Be careful with calling functions on the <a href="qgraphicsitem.html">QGraphicsItem</a> itself inside <a href="qgraphicsitem.html#itemChange">itemChange</a>(), as certain function calls can lead to unwanted recursion. For example, you cannot call <a href="qgraphicsitem.html#setPos">setPos</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() on an ItemPositionChange notification, as the <a href="qgraphicsitem.html#setPos">setPos</a>() function will again call <a href="qgraphicsitem.html#itemChange">itemChange</a>(ItemPositionChange). Instead, you can return the new, adjusted position from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</p>
<div class="table"><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"><code>QGraphicsItem::ItemEnabledChange</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">The item's enabled state changes. If the item is presently enabled, it will become disabled, and vice verca. The value argument is the new enabled state (i.e&#x2e;, true or false). Do not call <a href="qgraphicsitem.html#setEnabled">setEnabled</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered. Instead, you can return the new state from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemEnabledHasChanged</code></td><td class="topAlign tblval"><code>13</code></td><td class="topAlign">The item's enabled state has changed. The value argument is the new enabled state (i.e&#x2e;, true or false). Do not call <a href="qgraphicsitem.html#setEnabled">setEnabled</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered. The return value is ignored.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemMatrixChange</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The item's affine transformation matrix is changing. This value is obsolete; you can use ItemTransformChange instead.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemPositionChange</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The item's position changes. This notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a> flag is enabled, and when the item's local position changes, relative to its parent (i.e&#x2e;, as a result of calling <a href="qgraphicsitem.html#setPos">setPos</a>() or <a href="qgraphicsitem.html#moveBy">moveBy</a>()). The value argument is the new position (i.e&#x2e;, a <a href="../qtcore/qpointf.html">QPointF</a>). You can call <a href="qgraphicsitem.html#pos">pos</a>() to get the original position. Do not call <a href="qgraphicsitem.html#setPos">setPos</a>() or <a href="qgraphicsitem.html#moveBy">moveBy</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered; instead, you can return the new, adjusted position from <a href="qgraphicsitem.html#itemChange">itemChange</a>(). After this notification, <a href="qgraphicsitem.html">QGraphicsItem</a> immediately sends the ItemPositionHasChanged notification if the position changed.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemPositionHasChanged</code></td><td class="topAlign tblval"><code>9</code></td><td class="topAlign">The item's position has changed. This notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a> flag is enabled, and after the item's local position, relative to its parent, has changed. The value argument is the new position (the same as <a href="qgraphicsitem.html#pos">pos</a>()), and <a href="qgraphicsitem.html">QGraphicsItem</a> ignores the return value for this notification (i.e&#x2e;, a read-only notification).</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemTransformChange</code></td><td class="topAlign tblval"><code>8</code></td><td class="topAlign">The item's transformation matrix changes. This notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a> flag is enabled, and when the item's local transformation matrix changes (i.e&#x2e;, as a result of calling <a href="qgraphicsitem.html#setTransform">setTransform</a>(). The value argument is the new matrix (i.e&#x2e;, a <a href="../qtgui/qtransform.html">QTransform</a>); to get the old matrix, call <a href="qgraphicsitem.html#transform">transform</a>(). Do not call <a href="qgraphicsitem.html#setTransform">setTransform</a>() or set any of the transformation properties in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered; instead, you can return the new matrix from <a href="qgraphicsitem.html#itemChange">itemChange</a>(). This notification is not sent if you change the transformation properties.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemTransformHasChanged</code></td><td class="topAlign tblval"><code>10</code></td><td class="topAlign">The item's transformation matrix has changed either because <a href="qgraphicsitem.html#setTransform">setTransform</a> is called, or one of the transformation properties is changed. This notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a> flag is enabled, and after the item's local transformation matrix has changed. The value argument is the new matrix (same as <a href="qgraphicsitem.html#transform">transform</a>()), and <a href="qgraphicsitem.html">QGraphicsItem</a> ignores the return value for this notification (i.e&#x2e;, a read-only notification).</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemRotationChange</code></td><td class="topAlign tblval"><code>28</code></td><td class="topAlign">The item's rotation property changes. This notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a> flag is enabled, and when the item's rotation property changes (i.e&#x2e;, as a result of calling <a href="qgraphicsitem.html#setRotation">setRotation</a>()). The value argument is the new rotation (i.e&#x2e;, a double); to get the old rotation, call <a href="qgraphicsitem.html#rotation">rotation</a>(). Do not call <a href="qgraphicsitem.html#setRotation">setRotation</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered; instead, you can return the new rotation from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemRotationHasChanged</code></td><td class="topAlign tblval"><code>29</code></td><td class="topAlign">The item's rotation property has changed. This notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a> flag is enabled, and after the item's rotation property has changed. The value argument is the new rotation (i.e&#x2e;, a double), and <a href="qgraphicsitem.html">QGraphicsItem</a> ignores the return value for this notification (i.e&#x2e;, a read-only notification). Do not call <a href="qgraphicsitem.html#setRotation">setRotation</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemScaleChange</code></td><td class="topAlign tblval"><code>30</code></td><td class="topAlign">The item's scale property changes. This notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a> flag is enabled, and when the item's scale property changes (i.e&#x2e;, as a result of calling <a href="qgraphicsitem.html#setScale">setScale</a>()). The value argument is the new scale (i.e&#x2e;, a double); to get the old scale, call <a href="qgraphicsitem.html#scale">scale</a>(). Do not call <a href="qgraphicsitem.html#setScale">setScale</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered; instead, you can return the new scale from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemScaleHasChanged</code></td><td class="topAlign tblval"><code>31</code></td><td class="topAlign">The item's scale property has changed. This notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a> flag is enabled, and after the item's scale property has changed. The value argument is the new scale (i.e&#x2e;, a double), and <a href="qgraphicsitem.html">QGraphicsItem</a> ignores the return value for this notification (i.e&#x2e;, a read-only notification). Do not call <a href="qgraphicsitem.html#setScale">setScale</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemTransformOriginPointChange</code></td><td class="topAlign tblval"><code>32</code></td><td class="topAlign">The item's transform origin point property changes. This notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a> flag is enabled, and when the item's transform origin point property changes (i.e&#x2e;, as a result of calling <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>()). The value argument is the new origin point (i.e&#x2e;, a <a href="../qtcore/qpointf.html">QPointF</a>); to get the old origin point, call <a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a>(). Do not call <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered; instead, you can return the new transform origin point from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemTransformOriginPointHasChanged</code></td><td class="topAlign tblval"><code>33</code></td><td class="topAlign">The item's transform origin point property has changed. This notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a> flag is enabled, and after the item's transform origin point property has changed. The value argument is the new origin point (i.e&#x2e;, a <a href="../qtcore/qpointf.html">QPointF</a>), and <a href="qgraphicsitem.html">QGraphicsItem</a> ignores the return value for this notification (i.e&#x2e;, a read-only notification). Do not call <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemSelectedChange</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">The item's selected state changes. If the item is presently selected, it will become unselected, and vice verca. The value argument is the new selected state (i.e&#x2e;, true or false). Do not call <a href="qgraphicsitem.html#setSelected">setSelected</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered; instead, you can return the new selected state from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemSelectedHasChanged</code></td><td class="topAlign tblval"><code>14</code></td><td class="topAlign">The item's selected state has changed. The value argument is the new selected state (i.e&#x2e;, true or false). Do not call <a href="qgraphicsitem.html#setSelected">setSelected</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered. The return value is ignored.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemVisibleChange</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The item's visible state changes. If the item is presently visible, it will become invisible, and vice verca. The value argument is the new visible state (i.e&#x2e;, true or false). Do not call <a href="qgraphicsitem.html#setVisible">setVisible</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered; instead, you can return the new visible state from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemVisibleHasChanged</code></td><td class="topAlign tblval"><code>12</code></td><td class="topAlign">The item's visible state has changed. The value argument is the new visible state (i.e&#x2e;, true or false). Do not call <a href="qgraphicsitem.html#setVisible">setVisible</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered. The return value is ignored.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemParentChange</code></td><td class="topAlign tblval"><code>5</code></td><td class="topAlign">The item's parent changes. The value argument is the new parent item (i.e&#x2e;, a <a href="qgraphicsitem.html">QGraphicsItem</a> pointer). Do not call <a href="qgraphicsitem.html#setParentItem">setParentItem</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered; instead, you can return the new parent from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemParentHasChanged</code></td><td class="topAlign tblval"><code>15</code></td><td class="topAlign">The item's parent has changed. The value argument is the new parent (i.e&#x2e;, a pointer to a <a href="qgraphicsitem.html">QGraphicsItem</a>). Do not call <a href="qgraphicsitem.html#setParentItem">setParentItem</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered. The return value is ignored.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemChildAddedChange</code></td><td class="topAlign tblval"><code>6</code></td><td class="topAlign">A child is added to this item. The value argument is the new child item (i.e&#x2e;, a <a href="qgraphicsitem.html">QGraphicsItem</a> pointer). Do not pass this item to any item's <a href="qgraphicsitem.html#setParentItem">setParentItem</a>() function as this notification is delivered. The return value is unused; you cannot adjust anything in this notification. Note that the new child might not be fully constructed when this notification is sent; calling pure virtual functions on the child can lead to a crash.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemChildRemovedChange</code></td><td class="topAlign tblval"><code>7</code></td><td class="topAlign">A child is removed from this item. The value argument is the child item that is about to be removed (i.e&#x2e;, a <a href="qgraphicsitem.html">QGraphicsItem</a> pointer). The return value is unused; you cannot adjust anything in this notification.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemSceneChange</code></td><td class="topAlign tblval"><code>11</code></td><td class="topAlign">The item is moved to a new scene. This notification is also sent when the item is added to its initial scene, and when it is removed. The item's <a href="qgraphicsitem.html#scene">scene</a>() is the old scene (or 0 if the item has not been added to a scene yet). The value argument is the new scene (i.e&#x2e;, a <a href="qgraphicsscene.html">QGraphicsScene</a> pointer), or a null pointer if the item is removed from a scene. Do not override this change by passing this item to <a href="qgraphicsscene.html#addItem">QGraphicsScene::addItem</a>() as this notification is delivered; instead, you can return the new scene from <a href="qgraphicsitem.html#itemChange">itemChange</a>(). Use this feature with caution; objecting to a scene change can quickly lead to unwanted recursion.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemSceneHasChanged</code></td><td class="topAlign tblval"><code>16</code></td><td class="topAlign">The item's scene has changed. The item's <a href="qgraphicsitem.html#scene">scene</a>() is the new scene. This notification is also sent when the item is added to its initial scene, and when it is removed.The value argument is the new scene (i.e&#x2e;, a pointer to a <a href="qgraphicsscene.html">QGraphicsScene</a>). Do not call setScene() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered. The return value is ignored.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemCursorChange</code></td><td class="topAlign tblval"><code>17</code></td><td class="topAlign">The item's cursor changes. The value argument is the new cursor (i.e&#x2e;, a <a href="../qtgui/qcursor.html">QCursor</a>). Do not call <a href="qgraphicsitem.html#setCursor">setCursor</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered. Instead, you can return a new cursor from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemCursorHasChanged</code></td><td class="topAlign tblval"><code>18</code></td><td class="topAlign">The item's cursor has changed. The value argument is the new cursor (i.e&#x2e;, a <a href="../qtgui/qcursor.html">QCursor</a>). Do not call <a href="qgraphicsitem.html#setCursor">setCursor</a>() as this notification is delivered. The return value is ignored.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemToolTipChange</code></td><td class="topAlign tblval"><code>19</code></td><td class="topAlign">The item's tooltip changes. The value argument is the new tooltip (i.e&#x2e;, a <a href="qtooltip.html">QToolTip</a>). Do not call <a href="qgraphicsitem.html#setToolTip">setToolTip</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered. Instead, you can return a new tooltip from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemToolTipHasChanged</code></td><td class="topAlign tblval"><code>20</code></td><td class="topAlign">The item's tooltip has changed. The value argument is the new tooltip (i.e&#x2e;, a <a href="qtooltip.html">QToolTip</a>). Do not call <a href="qgraphicsitem.html#setToolTip">setToolTip</a>() as this notification is delivered. The return value is ignored.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemFlagsChange</code></td><td class="topAlign tblval"><code>21</code></td><td class="topAlign">The item's flags change. The value argument is the new flags (i.e&#x2e;, a quint32). Do not call <a href="qgraphicsitem.html#setFlags">setFlags</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered. Instead, you can return the new flags from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemFlagsHaveChanged</code></td><td class="topAlign tblval"><code>22</code></td><td class="topAlign">The item's flags have changed. The value argument is the new flags (i.e&#x2e;, a quint32). Do not call <a href="qgraphicsitem.html#setFlags">setFlags</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered. The return value is ignored.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemZValueChange</code></td><td class="topAlign tblval"><code>23</code></td><td class="topAlign">The item's Z-value changes. The value argument is the new Z-value (i.e&#x2e;, a double). Do not call <a href="qgraphicsitem.html#setZValue">setZValue</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered. Instead, you can return a new Z-value from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemZValueHasChanged</code></td><td class="topAlign tblval"><code>24</code></td><td class="topAlign">The item's Z-value has changed. The value argument is the new Z-value (i.e&#x2e;, a double). Do not call <a href="qgraphicsitem.html#setZValue">setZValue</a>() as this notification is delivered. The return value is ignored.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemOpacityChange</code></td><td class="topAlign tblval"><code>25</code></td><td class="topAlign">The item's opacity changes. The value argument is the new opacity (i.e&#x2e;, a double). Do not call <a href="qgraphicsitem.html#setOpacity">setOpacity</a>() in <a href="qgraphicsitem.html#itemChange">itemChange</a>() as this notification is delivered. Instead, you can return a new opacity from <a href="qgraphicsitem.html#itemChange">itemChange</a>().</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemOpacityHasChanged</code></td><td class="topAlign tblval"><code>26</code></td><td class="topAlign">The item's opacity has changed. The value argument is the new opacity (i.e&#x2e;, a double). Do not call <a href="qgraphicsitem.html#setOpacity">setOpacity</a>() as this notification is delivered. The return value is ignored.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemScenePositionHasChanged</code></td><td class="topAlign tblval"><code>27</code></td><td class="topAlign">The item's scene position has changed. This notification is sent if the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsScenePositionChanges</a> flag is enabled, and after the item's scene position has changed (i.e&#x2e;, the position or transformation of the item itself or the position or transformation of any ancestor has changed). The value argument is the new scene position (the same as <a href="qgraphicsitem.html#scenePos">scenePos</a>()), and <a href="qgraphicsitem.html">QGraphicsItem</a> ignores the return value for this notification (i.e&#x2e;, a read-only notification).</td></tr>
</table></div>
<!-- @@@GraphicsItemChange -->
<!-- $$$GraphicsItemFlag$$$ItemIsMovable$$$ItemIsSelectable$$$ItemIsFocusable$$$ItemClipsToShape$$$ItemClipsChildrenToShape$$$ItemIgnoresTransformations$$$ItemIgnoresParentOpacity$$$ItemDoesntPropagateOpacityToChildren$$$ItemStacksBehindParent$$$ItemUsesExtendedStyleOption$$$ItemHasNoContents$$$ItemSendsGeometryChanges$$$ItemAcceptsInputMethod$$$ItemNegativeZStacksBehindParent$$$ItemIsPanel$$$ItemIsFocusScope$$$ItemSendsScenePositionChanges$$$ItemStopsClickFocusPropagation$$$ItemStopsFocusHandling$$$ItemContainsChildrenInShape -->
<h3 class="flags" id="GraphicsItemFlag-enum"><a name="GraphicsItemFlag-enum"></a>enum QGraphicsItem::<span class="name">GraphicsItemFlag</span><br/>flags QGraphicsItem::<span class="name">GraphicsItemFlags</span></h3>
<p>This enum describes different flags that you can set on an item to toggle different features in the item's behavior.</p>
<p>All flags are disabled by default.</p>
<div class="table"><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"><code>QGraphicsItem::ItemIsMovable</code></td><td class="topAlign tblval"><code>0x1</code></td><td class="topAlign">The item supports interactive movement using the mouse. By clicking on the item and then dragging, the item will move together with the mouse cursor. If the item has children, all children are also moved. If the item is part of a selection, all selected items are also moved. This feature is provided as a convenience through the base implementation of <a href="qgraphicsitem.html">QGraphicsItem</a>'s mouse event handlers.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemIsSelectable</code></td><td class="topAlign tblval"><code>0x2</code></td><td class="topAlign">The item supports selection. Enabling this feature will enable <a href="qgraphicsitem.html#setSelected">setSelected</a>() to toggle selection for the item. It will also let the item be selected automatically as a result of calling <a href="qgraphicsscene.html#setSelectionArea">QGraphicsScene::setSelectionArea</a>(), by clicking on an item, or by using rubber band selection in <a href="qgraphicsview.html">QGraphicsView</a>.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemIsFocusable</code></td><td class="topAlign tblval"><code>0x4</code></td><td class="topAlign">The item supports keyboard input focus (i.e&#x2e;, it is an input item). Enabling this flag will allow the item to accept focus, which again allows the delivery of key events to <a href="qgraphicsitem.html#keyPressEvent">QGraphicsItem::keyPressEvent</a>() and <a href="qgraphicsitem.html#keyReleaseEvent">QGraphicsItem::keyReleaseEvent</a>().</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemClipsToShape</code></td><td class="topAlign tblval"><code>0x8</code></td><td class="topAlign">The item clips to its own shape. The item cannot draw or receive mouse, tablet, drag and drop or hover events outside its shape. It is disabled by default. This behavior is enforced by QGraphicsView::drawItems() or QGraphicsScene::drawItems(). This flag was introduced in Qt 4.3&#x2e;</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemClipsChildrenToShape</code></td><td class="topAlign tblval"><code>0x10</code></td><td class="topAlign">The item clips the painting of all its descendants to its own shape. Items that are either direct or indirect children of this item cannot draw outside this item's shape. By default, this flag is disabled; children can draw anywhere. This behavior is enforced by QGraphicsView::drawItems() or QGraphicsScene::drawItems(). This flag was introduced in Qt 4.3&#x2e;</td></tr>
</table></div>
<p><b>Note: </b>This flag is similar to ItemContainsChildrenInShape but in addition enforces the containment by clipping the children.</p><div class="table"><table class="valuelist"><tr valign="top" class="even"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemIgnoresTransformations</code></td><td class="topAlign tblval"><code>0x20</code></td><td class="topAlign">The item ignores inherited transformations (i.e&#x2e;, its position is still anchored to its parent, but the parent or view rotation, zoom or shear transformations are ignored). This flag is useful for keeping text label items horizontal and unscaled, so they will still be readable if the view is transformed. When set, the item's view geometry and scene geometry will be maintained separately. You must call <a href="qgraphicsitem.html#deviceTransform">deviceTransform</a>() to map coordinates and detect collisions in the view. By default, this flag is disabled. This flag was introduced in Qt 4.3&#x2e;</td></tr>
</table></div>
<p><b>Note: </b>With this flag set you can still scale the item itself, and that scale transformation will influence the item's children.</p><div class="table"><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"><code>QGraphicsItem::ItemIgnoresParentOpacity</code></td><td class="topAlign tblval"><code>0x40</code></td><td class="topAlign">The item ignores its parent's opacity. The item's effective opacity is the same as its own; it does not combine with the parent's opacity. This flags allows your item to keep its absolute opacity even if the parent is semitransparent. This flag was introduced in Qt 4.5&#x2e;</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemDoesntPropagateOpacityToChildren</code></td><td class="topAlign tblval"><code>0x80</code></td><td class="topAlign">The item doesn't propagate its opacity to its children. This flag allows you to create a semitransparent item that does not affect the opacity of its children. This flag was introduced in Qt 4.5&#x2e;</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemStacksBehindParent</code></td><td class="topAlign tblval"><code>0x100</code></td><td class="topAlign">The item is stacked behind its parent. By default, child items are stacked on top of the parent item. But setting this flag, the child will be stacked behind it. This flag is useful for drop shadow effects and for decoration objects that follow the parent item's geometry without drawing on top of it. This flag was introduced in Qt 4.5&#x2e;</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemUsesExtendedStyleOption</code></td><td class="topAlign tblval"><code>0x200</code></td><td class="topAlign">The item makes use of either <a href="qstyleoptiongraphicsitem.html#exposedRect-var">exposedRect</a> or <a href="qstyleoptiongraphicsitem-obsolete.html#matrix-var">matrix</a> in <a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a>. By default, the <a href="qstyleoptiongraphicsitem.html#exposedRect-var">exposedRect</a> is initialized to the item's <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() and the <a href="qstyleoptiongraphicsitem-obsolete.html#matrix-var">matrix</a> is untransformed. You can enable this flag for the style options to be set up with more fine-grained values. Note that QStyleOptionGraphicsItem::levelOfDetail is unaffected by this flag and always initialized to 1. Use <a href="qstyleoptiongraphicsitem.html#levelOfDetailFromTransform">QStyleOptionGraphicsItem::levelOfDetailFromTransform</a>() if you need a higher value. This flag was introduced in Qt 4.6&#x2e;</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemHasNoContents</code></td><td class="topAlign tblval"><code>0x400</code></td><td class="topAlign">The item does not paint anything (i.e&#x2e;, calling <a href="qgraphicsitem.html#paint">paint</a>() on the item has no effect). You should set this flag on items that do not need to be painted to ensure that Graphics View avoids unnecessary painting preparations. This flag was introduced in Qt 4.6&#x2e;</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemSendsGeometryChanges</code></td><td class="topAlign tblval"><code>0x800</code></td><td class="topAlign">The item enables <a href="qgraphicsitem.html#itemChange">itemChange</a>() notifications for <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemPositionChange</a>, <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemPositionHasChanged</a>, <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemMatrixChange</a>, <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemTransformChange</a>, <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemTransformHasChanged</a>, <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemRotationChange</a>, <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemRotationHasChanged</a>, <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemScaleChange</a>, <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemScaleHasChanged</a>, <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemTransformOriginPointChange</a>, and <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemTransformOriginPointHasChanged</a>. For performance reasons, these notifications are disabled by default. You must enable this flag to receive notifications for position and transform changes. This flag was introduced in Qt 4.6&#x2e;</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemAcceptsInputMethod</code></td><td class="topAlign tblval"><code>0x1000</code></td><td class="topAlign">The item supports input methods typically used for Asian languages. This flag was introduced in Qt 4.6&#x2e;</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemNegativeZStacksBehindParent</code></td><td class="topAlign tblval"><code>0x2000</code></td><td class="topAlign">The item automatically stacks behind it's parent if it's z-value is negative. This flag enables <a href="qgraphicsitem.html#setZValue">setZValue</a>() to toggle ItemStacksBehindParent. This flag was introduced in Qt 4.6&#x2e;</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemIsPanel</code></td><td class="topAlign tblval"><code>0x4000</code></td><td class="topAlign">The item is a panel. A panel provides activation and contained focus handling. Only one panel can be active at a time (see <a href="qgraphicsitem.html#isActive">QGraphicsItem::isActive</a>()). When no panel is active, <a href="qgraphicsscene.html">QGraphicsScene</a> activates all non-panel items. Window items (i.e&#x2e;, <a href="qgraphicsitem.html#isWindow">QGraphicsItem::isWindow</a>() returns <code>true</code>) are panels. This flag was introduced in Qt 4.6&#x2e;</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemSendsScenePositionChanges</code></td><td class="topAlign tblval"><code>0x10000</code></td><td class="topAlign">The item enables <a href="qgraphicsitem.html#itemChange">itemChange</a>() notifications for <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemScenePositionHasChanged</a>. For performance reasons, these notifications are disabled by default. You must enable this flag to receive notifications for scene position changes. This flag was introduced in Qt 4.6&#x2e;</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::ItemContainsChildrenInShape</code></td><td class="topAlign tblval"><code>0x80000</code></td><td class="topAlign">This flag indicates that all of the item's direct or indirect children only draw within the item's shape. Unlike ItemClipsChildrenToShape, this restriction is not enforced. Set ItemContainsChildrenInShape when you manually assure that drawing is bound to the item's shape and want to avoid the cost associated with enforcing the clip. Setting this flag enables more efficient drawing and collision detection. The flag is disabled by default.</td></tr>
</table></div>
<p><b>Note: </b>If both this flag and ItemClipsChildrenToShape are set, the clip will be enforced. This is equivalent to just setting ItemClipsChildrenToShape.</p><p>This flag was introduced in Qt 5.4&#x2e;</p>
<p>The GraphicsItemFlags type is a typedef for <a href="../qtcore/qflags.html">QFlags</a>&lt;GraphicsItemFlag&gt;. It stores an OR combination of GraphicsItemFlag values.</p>
<!-- @@@GraphicsItemFlag -->
<!-- $$$PanelModality$$$NonModal$$$PanelModal$$$SceneModal -->
<h3 class="fn" id="PanelModality-enum"><a name="PanelModality-enum"></a>enum QGraphicsItem::<span class="name">PanelModality</span></h3>
<p>This enum specifies the behavior of a modal panel. A modal panel is one that blocks input to other panels. Note that items that are children of a modal panel are not blocked.</p>
<p>The values are:</p>
<div class="table"><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"><code>QGraphicsItem::NonModal</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The panel is not modal and does not block input to other panels. This is the default value for panels.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::PanelModal</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The panel is modal to a single item hierarchy and blocks input to its parent pane, all grandparent panels, and all siblings of its parent and grandparent panels.</td></tr>
<tr><td class="topAlign"><code>QGraphicsItem::SceneModal</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The window is modal to the entire scene and blocks input to all panels.</td></tr>
</table></div>
<p>This enum was introduced or modified in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setPanelModality">QGraphicsItem::setPanelModality</a>(), <a href="qgraphicsitem.html#panelModality">QGraphicsItem::panelModality</a>(), and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">QGraphicsItem::ItemIsPanel</a>.</p>
<!-- @@@PanelModality -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QGraphicsItem[overload1]$$$QGraphicsItemQGraphicsItem* -->
<h3 class="fn" id="QGraphicsItem"><a name="QGraphicsItem"></a>QGraphicsItem::<span class="name">QGraphicsItem</span>(<span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Constructs a <a href="qgraphicsitem.html">QGraphicsItem</a> with the given <i>parent</i> item. It does not modify the parent object returned by <a href="../qtcore/qobject.html#parent">QObject::parent</a>().</p>
<p>If <i>parent</i> is 0, you can add the item to a scene by calling <a href="qgraphicsscene.html#addItem">QGraphicsScene::addItem</a>(). The item will then become a top-level item.</p>
<p><b>See also </b><a href="qgraphicsscene.html#addItem">QGraphicsScene::addItem</a>() and <a href="qgraphicsitem.html#setParentItem">setParentItem</a>().</p>
<!-- @@@QGraphicsItem -->
<!-- $$$~QGraphicsItem[overload1]$$$~QGraphicsItem -->
<h3 class="fn" id="dtor.QGraphicsItem"><a name="dtor.QGraphicsItem"></a><code>[virtual] </code>QGraphicsItem::<span class="name">~QGraphicsItem</span>()</h3>
<p>Destroys the <a href="qgraphicsitem.html">QGraphicsItem</a> and all its children. If this item is currently associated with a scene, the item will be removed from the scene before it is deleted.</p>
<p><b>Note: </b>It is more efficient to remove the item from the <a href="qgraphicsscene.html">QGraphicsScene</a> before destroying the item.</p><!-- @@@~QGraphicsItem -->
<!-- $$$acceptDrops[overload1]$$$acceptDrops -->
<h3 class="fn" id="acceptDrops"><a name="acceptDrops"></a><span class="type">bool</span> QGraphicsItem::<span class="name">acceptDrops</span>() const</h3>
<p>Returns <code>true</code> if this item can accept drag and drop events; otherwise, returns <code>false</code>. By default, items do not accept drag and drop events; items are transparent to drag and drop.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setAcceptDrops">setAcceptDrops</a>().</p>
<!-- @@@acceptDrops -->
<!-- $$$acceptHoverEvents[overload1]$$$acceptHoverEvents -->
<h3 class="fn" id="acceptHoverEvents"><a name="acceptHoverEvents"></a><span class="type">bool</span> QGraphicsItem::<span class="name">acceptHoverEvents</span>() const</h3>
<p>Returns <code>true</code> if an item accepts hover events (<a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a>); otherwise, returns <code>false</code>. By default, items do not accept hover events.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setAcceptHoverEvents">setAcceptHoverEvents</a>() and <a href="qgraphicsitem.html#setAcceptedMouseButtons">setAcceptedMouseButtons</a>().</p>
<!-- @@@acceptHoverEvents -->
<!-- $$$acceptTouchEvents[overload1]$$$acceptTouchEvents -->
<h3 class="fn" id="acceptTouchEvents"><a name="acceptTouchEvents"></a><span class="type">bool</span> QGraphicsItem::<span class="name">acceptTouchEvents</span>() const</h3>
<p>Returns <code>true</code> if an item accepts <a href="../qtgui/qtouchevent.html">touch events</a>; otherwise, returns <code>false</code>. By default, items do not accept touch events.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setAcceptTouchEvents">setAcceptTouchEvents</a>().</p>
<!-- @@@acceptTouchEvents -->
<!-- $$$acceptedMouseButtons[overload1]$$$acceptedMouseButtons -->
<h3 class="fn" id="acceptedMouseButtons"><a name="acceptedMouseButtons"></a><span class="type"><a href="../qtcore/qt.html#MouseButton-enum">Qt::MouseButtons</a></span> QGraphicsItem::<span class="name">acceptedMouseButtons</span>() const</h3>
<p>Returns the mouse buttons that this item accepts mouse events for. By default, all mouse buttons are accepted.</p>
<p>If an item accepts a mouse button, it will become the mouse grabber item when a mouse press event is delivered for that mouse button. However, if the item does not accept the button, <a href="qgraphicsscene.html">QGraphicsScene</a> will forward the mouse events to the first item beneath it that does.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setAcceptedMouseButtons">setAcceptedMouseButtons</a>() and <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>().</p>
<!-- @@@acceptedMouseButtons -->
<!-- $$$advance[overload1]$$$advanceint -->
<h3 class="fn" id="advance"><a name="advance"></a><code>[virtual] </code><span class="type">void</span> QGraphicsItem::<span class="name">advance</span>(<span class="type">int</span> <i>phase</i>)</h3>
<p>This virtual function is called twice for all items by the <a href="qgraphicsscene.html#advance">QGraphicsScene::advance</a>() slot. In the first phase, all items are called with <i>phase</i> == 0, indicating that items on the scene are about to advance, and then all items are called with <i>phase</i> == 1. Reimplement this function to update your item if you need simple scene-controlled animation.</p>
<p>The default implementation does nothing.</p>
<p>This function is intended for animations. An alternative is to multiple-inherit from <a href="../qtcore/qobject.html">QObject</a> and <a href="qgraphicsitem.html">QGraphicsItem</a> and use the <a href="../qtcore/animation-overview.html">Animation Framework</a>.</p>
<p><b>See also </b><a href="qgraphicsscene.html#advance">QGraphicsScene::advance</a>() and <a href="../qtcore/qtimeline.html">QTimeLine</a>.</p>
<!-- @@@advance -->
<!-- $$$boundingRect[overload1]$$$boundingRect -->
<h3 class="fn" id="boundingRect"><a name="boundingRect"></a><code>[pure virtual] </code><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsItem::<span class="name">boundingRect</span>() const</h3>
<p>This pure virtual function defines the outer bounds of the item as a rectangle; all painting must be restricted to inside an item's bounding rect. <a href="qgraphicsview.html">QGraphicsView</a> uses this to determine whether the item requires redrawing.</p>
<p>Although the item's shape can be arbitrary, the bounding rect is always rectangular, and it is unaffected by the items' transformation.</p>
<p>If you want to change the item's bounding rectangle, you must first call <a href="qgraphicsitem.html#prepareGeometryChange">prepareGeometryChange</a>(). This notifies the scene of the imminent change, so that it can update its item geometry index; otherwise, the scene will be unaware of the item's new geometry, and the results are undefined (typically, rendering artifacts are left within the view).</p>
<p>Reimplement this function to let <a href="qgraphicsview.html">QGraphicsView</a> determine what parts of the widget, if any, need to be redrawn.</p>
<p>Note: For shapes that paint an outline / stroke, it is important to include half the pen width in the bounding rect. It is not necessary to compensate for antialiasing, though.</p>
<p>Example:</p>
<pre class="cpp">

  <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> CircleItem<span class="operator">::</span>boundingRect() <span class="keyword">const</span>
  {
      <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> penWidth <span class="operator">=</span> <span class="number">1</span>;
      <span class="keyword">return</span> <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span>(<span class="operator">-</span>radius <span class="operator">-</span> penWidth <span class="operator">/</span> <span class="number">2</span><span class="operator">,</span> <span class="operator">-</span>radius <span class="operator">-</span> penWidth <span class="operator">/</span> <span class="number">2</span><span class="operator">,</span>
                    diameter <span class="operator">+</span> penWidth<span class="operator">,</span> diameter <span class="operator">+</span> penWidth);
  }

</pre>
<p><b>See also </b><a href="qgraphicsitem.html#boundingRegion">boundingRegion</a>(), <a href="qgraphicsitem.html#shape">shape</a>(), <a href="qgraphicsitem.html#contains">contains</a>(), <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>, and <a href="qgraphicsitem.html#prepareGeometryChange">prepareGeometryChange</a>().</p>
<!-- @@@boundingRect -->
<!-- $$$boundingRegion[overload1]$$$boundingRegionconstQTransform& -->
<h3 class="fn" id="boundingRegion"><a name="boundingRegion"></a><span class="type"><a href="../qtgui/qregion.html">QRegion</a></span> QGraphicsItem::<span class="name">boundingRegion</span>(const <span class="type"><a href="../qtgui/qtransform.html">QTransform</a></span> &amp;<i>itemToDeviceTransform</i>) const</h3>
<p>Returns the bounding region for this item. The coordinate space of the returned region depends on <i>itemToDeviceTransform</i>. If you pass an identity <a href="../qtgui/qtransform.html">QTransform</a> as a parameter, this function will return a local coordinate region.</p>
<p>The bounding region describes a coarse outline of the item's visual contents. Although it's expensive to calculate, it's also more precise than <a href="qgraphicsitem.html#boundingRect">boundingRect</a>(), and it can help to avoid unnecessary repainting when an item is updated. This is particularly efficient for thin items (e.g&#x2e;, lines or simple polygons). You can tune the granularity for the bounding region by calling <a href="qgraphicsitem.html#setBoundingRegionGranularity">setBoundingRegionGranularity</a>(). The default granularity is 0; in which the item's bounding region is the same as its bounding rect.</p>
<p><i>itemToDeviceTransform</i> is the transformation from item coordinates to device coordinates. If you want this function to return a <a href="../qtgui/qregion.html">QRegion</a> in scene coordinates, you can pass <a href="qgraphicsitem.html#sceneTransform">sceneTransform</a>() as an argument.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsitem.html#boundingRegionGranularity">boundingRegionGranularity</a>().</p>
<!-- @@@boundingRegion -->
<!-- $$$boundingRegionGranularity[overload1]$$$boundingRegionGranularity -->
<h3 class="fn" id="boundingRegionGranularity"><a name="boundingRegionGranularity"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QGraphicsItem::<span class="name">boundingRegionGranularity</span>() const</h3>
<p>Returns the item's bounding region granularity; a value between and including 0 and 1. The default value is 0 (i.e&#x2e;, the lowest granularity, where the bounding region corresponds to the item's bounding rectangle).</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setBoundingRegionGranularity">setBoundingRegionGranularity</a>().</p>
<!-- @@@boundingRegionGranularity -->
<!-- $$$cacheMode[overload1]$$$cacheMode -->
<h3 class="fn" id="cacheMode"><a name="cacheMode"></a><span class="type"><a href="qgraphicsitem.html#CacheMode-enum">CacheMode</a></span> QGraphicsItem::<span class="name">cacheMode</span>() const</h3>
<p>Returns the cache mode for this item. The default mode is <a href="qgraphicsitem.html#CacheMode-enum">NoCache</a> (i.e&#x2e;, cache is disabled and all painting is immediate).</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setCacheMode">setCacheMode</a>().</p>
<!-- @@@cacheMode -->
<!-- $$$childItems[overload1]$$$childItems -->
<h3 class="fn" id="childItems"><a name="childItems"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *&gt; QGraphicsItem::<span class="name">childItems</span>() const</h3>
<p>Returns a list of this item's children.</p>
<p>The items are sorted by stacking order. This takes into account both the items' insertion order and their Z-values.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setParentItem">setParentItem</a>(), <a href="qgraphicsitem.html#zValue">zValue</a>(), and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p>
<!-- @@@childItems -->
<!-- $$$childrenBoundingRect[overload1]$$$childrenBoundingRect -->
<h3 class="fn" id="childrenBoundingRect"><a name="childrenBoundingRect"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsItem::<span class="name">childrenBoundingRect</span>() const</h3>
<p>Returns the bounding rect of this item's descendants (i.e&#x2e;, its children, their children, etc.) in local coordinates. The rectangle will contain all descendants after they have been mapped to local coordinates. If the item has no children, this function returns an empty <a href="../qtcore/qrectf.html">QRectF</a>.</p>
<p>This does not include this item's own bounding rect; it only returns its descendants' accumulated bounding rect. If you need to include this item's bounding rect, you can add <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() to childrenBoundingRect() using QRectF::operator|().</p>
<p>This function is linear in complexity; it determines the size of the returned bounding rect by iterating through all descendants.</p>
<p><b>See also </b><a href="qgraphicsitem.html#boundingRect">boundingRect</a>() and <a href="qgraphicsitem.html#sceneBoundingRect">sceneBoundingRect</a>().</p>
<!-- @@@childrenBoundingRect -->
<!-- $$$clearFocus[overload1]$$$clearFocus -->
<h3 class="fn" id="clearFocus"><a name="clearFocus"></a><span class="type">void</span> QGraphicsItem::<span class="name">clearFocus</span>()</h3>
<p>Takes keyboard input focus from the item.</p>
<p>If it has focus, a <a href="qgraphicsitem.html#focusOutEvent">focus out event</a> is sent to this item to tell it that it is about to lose the focus.</p>
<p>Only items that set the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a> flag, or widgets that set an appropriate focus policy, can accept keyboard focus.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setFocus">setFocus</a>(), <a href="qgraphicsitem.html#hasFocus">hasFocus</a>(), and <a href="qgraphicswidget.html#focusPolicy-prop">QGraphicsWidget::focusPolicy</a>.</p>
<!-- @@@clearFocus -->
<!-- $$$clipPath[overload1]$$$clipPath -->
<h3 class="fn" id="clipPath"><a name="clipPath"></a><span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> QGraphicsItem::<span class="name">clipPath</span>() const</h3>
<p>Returns this item's clip path, or an empty <a href="../qtgui/qpainterpath.html">QPainterPath</a> if this item is not clipped. The clip path constrains the item's appearance and interaction (i.e&#x2e;, restricts the area the item can draw within and receive events for).</p>
<p>You can enable clipping by setting the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemClipsToShape</a> or <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemClipsChildrenToShape</a> flags. The item's clip path is calculated by intersecting all clipping ancestors' shapes. If the item sets <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemClipsToShape</a>, the final clip is intersected with the item's own shape.</p>
<p><b>Note: </b>Clipping introduces a performance penalty for all items involved; you should generally avoid using clipping if you can (e.g&#x2e;, if your items always draw inside <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() or <a href="qgraphicsitem.html#shape">shape</a>() boundaries, clipping is not necessary).</p><p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qgraphicsitem.html#isClipped">isClipped</a>(), <a href="qgraphicsitem.html#shape">shape</a>(), and <a href="qgraphicsitem.html#setFlags">setFlags</a>().</p>
<!-- @@@clipPath -->
<!-- $$$collidesWithItem[overload1]$$$collidesWithItemconstQGraphicsItem*Qt::ItemSelectionMode -->
<h3 class="fn" id="collidesWithItem"><a name="collidesWithItem"></a><code>[virtual] </code><span class="type">bool</span> QGraphicsItem::<span class="name">collidesWithItem</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>other</i>, <span class="type"><a href="../qtcore/qt.html#ItemSelectionMode-enum">Qt::ItemSelectionMode</a></span> <i>mode</i> = Qt::IntersectsItemShape) const</h3>
<p>Returns <code>true</code> if this item collides with <i>other</i>; otherwise returns <code>false</code>.</p>
<p>The <i>mode</i> is applied to <i>other</i>, and the resulting shape or bounding rectangle is then compared to this item's shape. The default value for <i>mode</i> is <a href="../qtcore/qt.html#ItemSelectionMode-enum">Qt::IntersectsItemShape</a>; <i>other</i> collides with this item if it either intersects, contains, or is contained by this item's shape (see <a href="../qtcore/qt.html#ItemSelectionMode-enum">Qt::ItemSelectionMode</a> for details).</p>
<p>The default implementation is based on shape intersection, and it calls <a href="qgraphicsitem.html#shape">shape</a>() on both items. Because the complexity of arbitrary shape-shape intersection grows with an order of magnitude when the shapes are complex, this operation can be noticably time consuming. You have the option of reimplementing this function in a subclass of <a href="qgraphicsitem.html">QGraphicsItem</a> to provide a custom algorithm. This allows you to make use of natural constraints in the shapes of your own items, in order to improve the performance of the collision detection. For instance, two untransformed perfectly circular items' collision can be determined very efficiently by comparing their positions and radii.</p>
<p>Keep in mind that when reimplementing this function and calling <a href="qgraphicsitem.html#shape">shape</a>() or <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() on <i>other</i>, the returned coordinates must be mapped to this item's coordinate system before any intersection can take place.</p>
<p><b>See also </b><a href="qgraphicsitem.html#contains">contains</a>() and <a href="qgraphicsitem.html#shape">shape</a>().</p>
<!-- @@@collidesWithItem -->
<!-- $$$collidesWithPath[overload1]$$$collidesWithPathconstQPainterPath&Qt::ItemSelectionMode -->
<h3 class="fn" id="collidesWithPath"><a name="collidesWithPath"></a><code>[virtual] </code><span class="type">bool</span> QGraphicsItem::<span class="name">collidesWithPath</span>(const <span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> &amp;<i>path</i>, <span class="type"><a href="../qtcore/qt.html#ItemSelectionMode-enum">Qt::ItemSelectionMode</a></span> <i>mode</i> = Qt::IntersectsItemShape) const</h3>
<p>Returns <code>true</code> if this item collides with <i>path</i>.</p>
<p>The collision is determined by <i>mode</i>. The default value for <i>mode</i> is <a href="../qtcore/qt.html#ItemSelectionMode-enum">Qt::IntersectsItemShape</a>; <i>path</i> collides with this item if it either intersects, contains, or is contained by this item's shape.</p>
<p>Note that this function checks whether the item's shape or bounding rectangle (depending on <i>mode</i>) is contained within <i>path</i>, and not whether <i>path</i> is contained within the items shape or bounding rectangle.</p>
<p><b>See also </b><a href="qgraphicsitem.html#collidesWithItem">collidesWithItem</a>(), <a href="qgraphicsitem.html#contains">contains</a>(), and <a href="qgraphicsitem.html#shape">shape</a>().</p>
<!-- @@@collidesWithPath -->
<!-- $$$collidingItems[overload1]$$$collidingItemsQt::ItemSelectionMode -->
<h3 class="fn" id="collidingItems"><a name="collidingItems"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *&gt; QGraphicsItem::<span class="name">collidingItems</span>(<span class="type"><a href="../qtcore/qt.html#ItemSelectionMode-enum">Qt::ItemSelectionMode</a></span> <i>mode</i> = Qt::IntersectsItemShape) const</h3>
<p>Returns a list of all items that collide with this item.</p>
<p>The way collisions are detected is determined by applying <i>mode</i> to items that are compared to this item, i.e&#x2e;, each item's shape or bounding rectangle is checked against this item's shape. The default value for <i>mode</i> is <a href="../qtcore/qt.html#ItemSelectionMode-enum">Qt::IntersectsItemShape</a>.</p>
<p><b>See also </b><a href="qgraphicsitem.html#collidesWithItem">collidesWithItem</a>().</p>
<!-- @@@collidingItems -->
<!-- $$$commonAncestorItem[overload1]$$$commonAncestorItemconstQGraphicsItem* -->
<h3 class="fn" id="commonAncestorItem"><a name="commonAncestorItem"></a><span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *QGraphicsItem::<span class="name">commonAncestorItem</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>other</i>) const</h3>
<p>Returns the closest common ancestor item of this item and <i>other</i>, or 0 if either <i>other</i> is 0, or there is no common ancestor.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsitem.html#isAncestorOf">isAncestorOf</a>().</p>
<!-- @@@commonAncestorItem -->
<!-- $$$contains[overload1]$$$containsconstQPointF& -->
<h3 class="fn" id="contains"><a name="contains"></a><code>[virtual] </code><span class="type">bool</span> QGraphicsItem::<span class="name">contains</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>point</i>) const</h3>
<p>Returns <code>true</code> if this item contains <i>point</i>, which is in local coordinates; otherwise, false is returned. It is most often called from <a href="qgraphicsview.html">QGraphicsView</a> to determine what item is under the cursor, and for that reason, the implementation of this function should be as light-weight as possible.</p>
<p>By default, this function calls <a href="qgraphicsitem.html#shape">shape</a>(), but you can reimplement it in a subclass to provide a (perhaps more efficient) implementation.</p>
<p><b>See also </b><a href="qgraphicsitem.html#shape">shape</a>(), <a href="qgraphicsitem.html#boundingRect">boundingRect</a>(), and <a href="qgraphicsitem.html#collidesWithPath">collidesWithPath</a>().</p>
<!-- @@@contains -->
<!-- $$$contextMenuEvent[overload1]$$$contextMenuEventQGraphicsSceneContextMenuEvent* -->
<h3 class="fn" id="contextMenuEvent"><a name="contextMenuEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">contextMenuEvent</span>(<span class="type"><a href="qgraphicsscenecontextmenuevent.html">QGraphicsSceneContextMenuEvent</a></span> *<i>event</i>)</h3>
<p>This event handler can be reimplemented in a subclass to process context menu events. The <i>event</i> parameter contains details about the event to be handled.</p>
<p>If you ignore the event (i.e&#x2e;, by calling <a href="../qtcore/qevent.html#ignore">QEvent::ignore</a>()), <i>event</i> will propagate to any item beneath this item. If no items accept the event, it will be ignored by the scene and propagate to the view.</p>
<p>It's common to open a <a href="qmenu.html">QMenu</a> in response to receiving a context menu event. Example:</p>
<pre class="cpp">

  <span class="type">void</span> CustomItem<span class="operator">::</span>contextMenuEvent(<span class="type"><a href="qgraphicsscenecontextmenuevent.html">QGraphicsSceneContextMenuEvent</a></span> <span class="operator">*</span>event)
  {
      <span class="type"><a href="qmenu.html">QMenu</a></span> menu;
      <span class="type"><a href="qaction.html">QAction</a></span> <span class="operator">*</span>removeAction <span class="operator">=</span> menu<span class="operator">.</span>addAction(<span class="string">&quot;Remove&quot;</span>);
      <span class="type"><a href="qaction.html">QAction</a></span> <span class="operator">*</span>markAction <span class="operator">=</span> menu<span class="operator">.</span>addAction(<span class="string">&quot;Mark&quot;</span>);
      <span class="type"><a href="qaction.html">QAction</a></span> <span class="operator">*</span>selectedAction <span class="operator">=</span> menu<span class="operator">.</span>exec(event<span class="operator">-</span><span class="operator">&gt;</span>screenPos());
      <span class="comment">// ...</span>
  }

</pre>
<p>The default implementation ignores the event.</p>
<p><b>See also </b><a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<!-- @@@contextMenuEvent -->
<!-- $$$cursor[overload1]$$$cursor -->
<h3 class="fn" id="cursor"><a name="cursor"></a><span class="type"><a href="../qtgui/qcursor.html">QCursor</a></span> QGraphicsItem::<span class="name">cursor</span>() const</h3>
<p>Returns the current cursor shape for the item. The mouse cursor will assume this shape when it's over this item. See the <a href="../qtcore/qt.html#CursorShape-enum">list of predefined cursor objects</a> for a range of useful shapes.</p>
<p>An editor item might want to use an I-beam cursor:</p>
<pre class="cpp">

  item<span class="operator">-</span><span class="operator">&gt;</span>setCursor(<span class="type"><a href="../qtcore/qt.html">Qt</a></span><span class="operator">::</span>IBeamCursor);

</pre>
<p>If no cursor has been set, the cursor of the item beneath is used.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setCursor">setCursor</a>(), <a href="qgraphicsitem.html#hasCursor">hasCursor</a>(), <a href="qgraphicsitem.html#unsetCursor">unsetCursor</a>(), <a href="qwidget.html#cursor-prop">QWidget::cursor</a>, and <a href="../qtgui/qguiapplication.html#overrideCursor">QApplication::overrideCursor</a>().</p>
<!-- @@@cursor -->
<!-- $$$data[overload1]$$$dataint -->
<h3 class="fn" id="data"><a name="data"></a><span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> QGraphicsItem::<span class="name">data</span>(<span class="type">int</span> <i>key</i>) const</h3>
<p>Returns this item's custom data for the key <i>key</i> as a <a href="../qtcore/qvariant.html">QVariant</a>.</p>
<p>Custom item data is useful for storing arbitrary properties in any item. Example:</p>
<pre class="cpp">

  <span class="keyword">static</span> <span class="keyword">const</span> <span class="type">int</span> ObjectName <span class="operator">=</span> <span class="number">0</span>;

  <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> <span class="operator">*</span>item <span class="operator">=</span> scene<span class="operator">.</span>itemAt(<span class="number">100</span><span class="operator">,</span> <span class="number">50</span>);
  <span class="keyword">if</span> (item<span class="operator">-</span><span class="operator">&gt;</span>data(ObjectName)<span class="operator">.</span>toString()<span class="operator">.</span>isEmpty()) {
      <span class="keyword">if</span> (qgraphicsitem_cast<span class="operator">&lt;</span>ButtonItem <span class="operator">*</span><span class="operator">&gt;</span>(item))
          item<span class="operator">-</span><span class="operator">&gt;</span>setData(ObjectName<span class="operator">,</span> <span class="string">&quot;Button&quot;</span>);
  }

</pre>
<p>Qt does not use this feature for storing data; it is provided solely for the convenience of the user.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setData">setData</a>().</p>
<!-- @@@data -->
<!-- $$$deviceTransform[overload1]$$$deviceTransformconstQTransform& -->
<h3 class="fn" id="deviceTransform"><a name="deviceTransform"></a><span class="type"><a href="../qtgui/qtransform.html">QTransform</a></span> QGraphicsItem::<span class="name">deviceTransform</span>(const <span class="type"><a href="../qtgui/qtransform.html">QTransform</a></span> &amp;<i>viewportTransform</i>) const</h3>
<p>Returns this item's device transformation matrix, using <i>viewportTransform</i> to map from scene to device coordinates. This matrix can be used to map coordinates and geometrical shapes from this item's local coordinate system to the viewport's (or any device's) coordinate system. To map coordinates from the viewport, you must first invert the returned matrix.</p>
<p>Example:</p>
<pre class="cpp">

  <span class="type"><a href="qgraphicsrectitem.html">QGraphicsRectItem</a></span> rect;
  rect<span class="operator">.</span>setPos(<span class="number">100</span><span class="operator">,</span> <span class="number">100</span>);

  rect<span class="operator">.</span>deviceTransform(view<span class="operator">-</span><span class="operator">&gt;</span>viewportTransform())<span class="operator">.</span>map(<span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span>(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span>));
  <span class="comment">// returns the item's (0, 0) point in view's viewport coordinates</span>

  rect<span class="operator">.</span>deviceTransform(view<span class="operator">-</span><span class="operator">&gt;</span>viewportTransform())<span class="operator">.</span>inverted()<span class="operator">.</span>map(<span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span>(<span class="number">100</span><span class="operator">,</span> <span class="number">100</span>));
  <span class="comment">// returns view's viewport's (100, 100) coordinate in item coordinates</span>

</pre>
<p>This function is the same as combining this item's scene transform with the view's viewport transform, but it also understands the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIgnoresTransformations</a> flag. The device transform can be used to do accurate coordinate mapping (and collision detection) for untransformable items.</p>
<p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#setTransform">setTransform</a>(), <a href="qgraphicsitem.html#scenePos">scenePos</a>(), <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>, and <a href="qgraphicsitem.html#itemTransform">itemTransform</a>().</p>
<!-- @@@deviceTransform -->
<!-- $$$dragEnterEvent[overload1]$$$dragEnterEventQGraphicsSceneDragDropEvent* -->
<h3 class="fn" id="dragEnterEvent"><a name="dragEnterEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">dragEnterEvent</span>(<span class="type"><a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for event <i>event</i>, can be reimplemented to receive drag enter events for this item. Drag enter events are generated as the cursor enters the item's area.</p>
<p>By accepting the event (i.e&#x2e;, by calling <a href="../qtcore/qevent.html#accept">QEvent::accept</a>()), the item will accept drop events, in addition to receiving drag move and drag leave. Otherwise, the event will be ignored and propagate to the item beneath. If the event is accepted, the item will receive a drag move event before control goes back to the event loop.</p>
<p>A common implementation of dragEnterEvent accepts or ignores <i>event</i> depending on the associated mime data in <i>event</i>. Example:</p>
<pre class="cpp">

  CustomItem<span class="operator">::</span>CustomItem()
  {
      setAcceptDrops(<span class="keyword">true</span>);
      <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
  }

  <span class="type">void</span> CustomItem<span class="operator">::</span>dragEnterEvent(<span class="type"><a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a></span> <span class="operator">*</span>event)
  {
      event<span class="operator">-</span><span class="operator">&gt;</span>setAccepted(event<span class="operator">-</span><span class="operator">&gt;</span>mimeData()<span class="operator">-</span><span class="operator">&gt;</span>hasFormat(<span class="string">&quot;text/plain&quot;</span>));
  }

</pre>
<p>Items do not receive drag and drop events by default; to enable this feature, call <code>setAcceptDrops(true)</code>.</p>
<p>The default implementation does nothing.</p>
<p><b>See also </b><a href="qgraphicsitem.html#dropEvent">dropEvent</a>(), <a href="qgraphicsitem.html#dragMoveEvent">dragMoveEvent</a>(), and <a href="qgraphicsitem.html#dragLeaveEvent">dragLeaveEvent</a>().</p>
<!-- @@@dragEnterEvent -->
<!-- $$$dragLeaveEvent[overload1]$$$dragLeaveEventQGraphicsSceneDragDropEvent* -->
<h3 class="fn" id="dragLeaveEvent"><a name="dragLeaveEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">dragLeaveEvent</span>(<span class="type"><a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for event <i>event</i>, can be reimplemented to receive drag leave events for this item. Drag leave events are generated as the cursor leaves the item's area. Most often you will not need to reimplement this function, but it can be useful for resetting state in your item (e.g&#x2e;, highlighting).</p>
<p>Calling <a href="../qtcore/qevent.html#ignore">QEvent::ignore</a>() or <a href="../qtcore/qevent.html#accept">QEvent::accept</a>() on <i>event</i> has no effect.</p>
<p>Items do not receive drag and drop events by default; to enable this feature, call <code>setAcceptDrops(true)</code>.</p>
<p>The default implementation does nothing.</p>
<p><b>See also </b><a href="qgraphicsitem.html#dragEnterEvent">dragEnterEvent</a>(), <a href="qgraphicsitem.html#dropEvent">dropEvent</a>(), and <a href="qgraphicsitem.html#dragMoveEvent">dragMoveEvent</a>().</p>
<!-- @@@dragLeaveEvent -->
<!-- $$$dragMoveEvent[overload1]$$$dragMoveEventQGraphicsSceneDragDropEvent* -->
<h3 class="fn" id="dragMoveEvent"><a name="dragMoveEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">dragMoveEvent</span>(<span class="type"><a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for event <i>event</i>, can be reimplemented to receive drag move events for this item. Drag move events are generated as the cursor moves around inside the item's area. Most often you will not need to reimplement this function; it is used to indicate that only parts of the item can accept drops.</p>
<p>Calling <a href="../qtcore/qevent.html#ignore">QEvent::ignore</a>() or <a href="../qtcore/qevent.html#accept">QEvent::accept</a>() on <i>event</i> toggles whether or not the item will accept drops at the position from the event. By default, <i>event</i> is accepted, indicating that the item allows drops at the specified position.</p>
<p>Items do not receive drag and drop events by default; to enable this feature, call <code>setAcceptDrops(true)</code>.</p>
<p>The default implementation does nothing.</p>
<p><b>See also </b><a href="qgraphicsitem.html#dropEvent">dropEvent</a>(), <a href="qgraphicsitem.html#dragEnterEvent">dragEnterEvent</a>(), and <a href="qgraphicsitem.html#dragLeaveEvent">dragLeaveEvent</a>().</p>
<!-- @@@dragMoveEvent -->
<!-- $$$dropEvent[overload1]$$$dropEventQGraphicsSceneDragDropEvent* -->
<h3 class="fn" id="dropEvent"><a name="dropEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">dropEvent</span>(<span class="type"><a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for event <i>event</i>, can be reimplemented to receive drop events for this item. Items can only receive drop events if the last drag move event was accepted.</p>
<p>Calling <a href="../qtcore/qevent.html#ignore">QEvent::ignore</a>() or <a href="../qtcore/qevent.html#accept">QEvent::accept</a>() on <i>event</i> has no effect.</p>
<p>Items do not receive drag and drop events by default; to enable this feature, call <code>setAcceptDrops(true)</code>.</p>
<p>The default implementation does nothing.</p>
<p><b>See also </b><a href="qgraphicsitem.html#dragEnterEvent">dragEnterEvent</a>(), <a href="qgraphicsitem.html#dragMoveEvent">dragMoveEvent</a>(), and <a href="qgraphicsitem.html#dragLeaveEvent">dragLeaveEvent</a>().</p>
<!-- @@@dropEvent -->
<!-- $$$effectiveOpacity[overload1]$$$effectiveOpacity -->
<h3 class="fn" id="effectiveOpacity"><a name="effectiveOpacity"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QGraphicsItem::<span class="name">effectiveOpacity</span>() const</h3>
<p>Returns this item's <i>effective</i> opacity, which is between 0.0 (transparent) and 1.0 (opaque). This value is a combination of this item's local opacity, and its parent and ancestors' opacities. The effective opacity decides how the item is rendered.</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qgraphicsitem.html#opacity">opacity</a>(), <a href="qgraphicsitem.html#setOpacity">setOpacity</a>(), <a href="qgraphicsitem.html#paint">paint</a>(), <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIgnoresParentOpacity</a>, and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemDoesntPropagateOpacityToChildren</a>.</p>
<!-- @@@effectiveOpacity -->
<!-- $$$ensureVisible[overload1]$$$ensureVisibleconstQRectF&intint -->
<h3 class="fn" id="ensureVisible"><a name="ensureVisible"></a><span class="type">void</span> QGraphicsItem::<span class="name">ensureVisible</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i> = QRectF(), <span class="type">int</span> <i>xmargin</i> = 50, <span class="type">int</span> <i>ymargin</i> = 50)</h3>
<p>If this item is part of a scene that is viewed by a <a href="qgraphicsview.html">QGraphicsView</a>, this convenience function will attempt to scroll the view to ensure that <i>rect</i> is visible inside the view's viewport. If <i>rect</i> is a null rect (the default), <a href="qgraphicsitem.html">QGraphicsItem</a> will default to the item's bounding rect. <i>xmargin</i> and <i>ymargin</i> are the number of pixels the view should use for margins.</p>
<p>If the specified rect cannot be reached, the contents are scrolled to the nearest valid position.</p>
<p>If this item is not viewed by a <a href="qgraphicsview.html">QGraphicsView</a>, this function does nothing.</p>
<p><b>See also </b><a href="qgraphicsview.html#ensureVisible">QGraphicsView::ensureVisible</a>().</p>
<!-- @@@ensureVisible -->
<!-- $$$ensureVisible$$$ensureVisibleqrealqrealqrealqrealintint -->
<h3 class="fn" id="ensureVisible-1"><a name="ensureVisible-1"></a><span class="type">void</span> QGraphicsItem::<span class="name">ensureVisible</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>, <span class="type">int</span> <i>xmargin</i> = 50, <span class="type">int</span> <i>ymargin</i> = 50)</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#ensureVisible">ensureVisible</a>(<a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>), <i>xmargin</i>, <i>ymargin</i>).</p>
<!-- @@@ensureVisible -->
<!-- $$$filtersChildEvents[overload1]$$$filtersChildEvents -->
<h3 class="fn" id="filtersChildEvents"><a name="filtersChildEvents"></a><span class="type">bool</span> QGraphicsItem::<span class="name">filtersChildEvents</span>() const</h3>
<p>Returns <code>true</code> if this item filters child events (i.e&#x2e;, all events intended for any of its children are instead sent to this item); otherwise, false is returned.</p>
<p>The default value is false; child events are not filtered.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setFiltersChildEvents">setFiltersChildEvents</a>().</p>
<!-- @@@filtersChildEvents -->
<!-- $$$flags[overload1]$$$flags -->
<h3 class="fn" id="flags"><a name="flags"></a><span class="type"><a href="qgraphicsitem.html#GraphicsItemFlag-enum">GraphicsItemFlags</a></span> QGraphicsItem::<span class="name">flags</span>() const</h3>
<p>Returns this item's flags. The flags describe what configurable features of the item are enabled and not. For example, if the flags include <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a>, the item can accept input focus.</p>
<p>By default, no flags are enabled.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setFlags">setFlags</a>() and <a href="qgraphicsitem.html#setFlag">setFlag</a>().</p>
<!-- @@@flags -->
<!-- $$$focusInEvent[overload1]$$$focusInEventQFocusEvent* -->
<h3 class="fn" id="focusInEvent"><a name="focusInEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">focusInEvent</span>(<span class="type"><a href="../qtgui/qfocusevent.html">QFocusEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for event <i>event</i>, can be reimplemented to receive focus in events for this item. The default implementation calls <a href="qgraphicsitem.html#ensureVisible">ensureVisible</a>().</p>
<p><b>See also </b><a href="qgraphicsitem.html#focusOutEvent">focusOutEvent</a>(), <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>(), and <a href="qgraphicsitem.html#setFocus">setFocus</a>().</p>
<!-- @@@focusInEvent -->
<!-- $$$focusItem[overload1]$$$focusItem -->
<h3 class="fn" id="focusItem"><a name="focusItem"></a><span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *QGraphicsItem::<span class="name">focusItem</span>() const</h3>
<p>If this item, a child or descendant of this item currently has input focus, this function will return a pointer to that item. If no descendant has input focus, 0 is returned.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#hasFocus">hasFocus</a>(), <a href="qgraphicsitem.html#setFocus">setFocus</a>(), and <a href="qwidget.html#focusWidget">QWidget::focusWidget</a>().</p>
<!-- @@@focusItem -->
<!-- $$$focusOutEvent[overload1]$$$focusOutEventQFocusEvent* -->
<h3 class="fn" id="focusOutEvent"><a name="focusOutEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">focusOutEvent</span>(<span class="type"><a href="../qtgui/qfocusevent.html">QFocusEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for event <i>event</i>, can be reimplemented to receive focus out events for this item. The default implementation does nothing.</p>
<p><b>See also </b><a href="qgraphicsitem.html#focusInEvent">focusInEvent</a>(), <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>(), and <a href="qgraphicsitem.html#setFocus">setFocus</a>().</p>
<!-- @@@focusOutEvent -->
<!-- $$$focusProxy[overload1]$$$focusProxy -->
<h3 class="fn" id="focusProxy"><a name="focusProxy"></a><span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *QGraphicsItem::<span class="name">focusProxy</span>() const</h3>
<p>Returns this item's focus proxy, or 0 if this item has no focus proxy.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setFocusProxy">setFocusProxy</a>(), <a href="qgraphicsitem.html#setFocus">setFocus</a>(), and <a href="qgraphicsitem.html#hasFocus">hasFocus</a>().</p>
<!-- @@@focusProxy -->
<!-- $$$grabKeyboard[overload1]$$$grabKeyboard -->
<h3 class="fn" id="grabKeyboard"><a name="grabKeyboard"></a><span class="type">void</span> QGraphicsItem::<span class="name">grabKeyboard</span>()</h3>
<p>Grabs the keyboard input.</p>
<p>The item will receive all keyboard input to the scene until one of the following events occur:</p>
<ul>
<li>The item becomes invisible</li>
<li>The item is removed from the scene</li>
<li>The item is deleted</li>
<li>The item calls <a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a>()</li>
<li>Another item calls grabKeyboard(); the item will regain the keyboard grab when the other item calls <a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a>().</li>
</ul>
<p>When an item gains the keyboard grab, it receives a <a href="../qtcore/qevent.html#Type-enum">QEvent::GrabKeyboard</a> event. When it loses the keyboard grab, it receives a <a href="../qtcore/qevent.html#Type-enum">QEvent::UngrabKeyboard</a> event. These events can be used to detect when your item gains or loses the keyboard grab through other means than gaining input focus.</p>
<p>It is almost never necessary to explicitly grab the keyboard in Qt, as Qt grabs and releases it sensibly. In particular, Qt grabs the keyboard when your item gains input focus, and releases it when your item loses input focus, or when the item is hidden.</p>
<p>Note that only visible items can grab keyboard input. Calling grabKeyboard() on an invisible item has no effect.</p>
<p>Keyboard events are not affected.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a>(), <a href="qgraphicsitem.html#grabMouse">grabMouse</a>(), and <a href="qgraphicsitem.html#setFocus">setFocus</a>().</p>
<!-- @@@grabKeyboard -->
<!-- $$$grabMouse[overload1]$$$grabMouse -->
<h3 class="fn" id="grabMouse"><a name="grabMouse"></a><span class="type">void</span> QGraphicsItem::<span class="name">grabMouse</span>()</h3>
<p>Grabs the mouse input.</p>
<p>This item will receive all mouse events for the scene until any of the following events occurs:</p>
<ul>
<li>The item becomes invisible</li>
<li>The item is removed from the scene</li>
<li>The item is deleted</li>
<li>The item call <a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>()</li>
<li>Another item calls grabMouse(); the item will regain the mouse grab when the other item calls <a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>().</li>
</ul>
<p>When an item gains the mouse grab, it receives a <a href="../qtcore/qevent.html#Type-enum">QEvent::GrabMouse</a> event. When it loses the mouse grab, it receives a <a href="../qtcore/qevent.html#Type-enum">QEvent::UngrabMouse</a> event. These events can be used to detect when your item gains or loses the mouse grab through other means than receiving mouse button events.</p>
<p>It is almost never necessary to explicitly grab the mouse in Qt, as Qt grabs and releases it sensibly. In particular, Qt grabs the mouse when you press a mouse button, and keeps the mouse grabbed until you release the last mouse button. Also, <a href="../qtcore/qt.html#WindowType-enum">Qt::Popup</a> widgets implicitly call grabMouse() when shown, and <a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>() when hidden.</p>
<p>Note that only visible items can grab mouse input. Calling grabMouse() on an invisible item has no effect.</p>
<p>Keyboard events are not affected.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsscene.html#mouseGrabberItem">QGraphicsScene::mouseGrabberItem</a>(), <a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>(), and <a href="qgraphicsitem.html#grabKeyboard">grabKeyboard</a>().</p>
<!-- @@@grabMouse -->
<!-- $$$graphicsEffect[overload1]$$$graphicsEffect -->
<h3 class="fn" id="graphicsEffect"><a name="graphicsEffect"></a><span class="type"><a href="qgraphicseffect.html">QGraphicsEffect</a></span> *QGraphicsItem::<span class="name">graphicsEffect</span>() const</h3>
<p>Returns a pointer to this item's effect if it has one; otherwise 0.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setGraphicsEffect">setGraphicsEffect</a>().</p>
<!-- @@@graphicsEffect -->
<!-- $$$group[overload1]$$$group -->
<h3 class="fn" id="group"><a name="group"></a><span class="type"><a href="qgraphicsitemgroup.html">QGraphicsItemGroup</a></span> *QGraphicsItem::<span class="name">group</span>() const</h3>
<p>Returns a pointer to this item's item group, or 0 if this item is not member of a group.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setGroup">setGroup</a>(), <a href="qgraphicsitemgroup.html">QGraphicsItemGroup</a>, and <a href="qgraphicsscene.html#createItemGroup">QGraphicsScene::createItemGroup</a>().</p>
<!-- @@@group -->
<!-- $$$hasCursor[overload1]$$$hasCursor -->
<h3 class="fn" id="hasCursor"><a name="hasCursor"></a><span class="type">bool</span> QGraphicsItem::<span class="name">hasCursor</span>() const</h3>
<p>Returns <code>true</code> if this item has a cursor set; otherwise, false is returned.</p>
<p>By default, items don't have any cursor set. <a href="qgraphicsitem.html#cursor">cursor</a>() will return a standard pointing arrow cursor.</p>
<p><b>See also </b><a href="qgraphicsitem.html#unsetCursor">unsetCursor</a>().</p>
<!-- @@@hasCursor -->
<!-- $$$hasFocus[overload1]$$$hasFocus -->
<h3 class="fn" id="hasFocus"><a name="hasFocus"></a><span class="type">bool</span> QGraphicsItem::<span class="name">hasFocus</span>() const</h3>
<p>Returns <code>true</code> if this item is active, and it or its <a href="qgraphicsitem.html#focusProxy">focus proxy</a> has keyboard input focus; otherwise, returns <code>false</code>.</p>
<p><b>See also </b><a href="qgraphicsitem.html#focusItem">focusItem</a>(), <a href="qgraphicsitem.html#setFocus">setFocus</a>(), <a href="qgraphicsscene.html#setFocusItem">QGraphicsScene::setFocusItem</a>(), and <a href="qgraphicsitem.html#isActive">isActive</a>().</p>
<!-- @@@hasFocus -->
<!-- $$$hide[overload1]$$$hide -->
<h3 class="fn" id="hide"><a name="hide"></a><span class="type">void</span> QGraphicsItem::<span class="name">hide</span>()</h3>
<p>Hides the item (items are visible by default).</p>
<p>This convenience function is equivalent to calling <code>setVisible(false)</code>.</p>
<p><b>See also </b><a href="qgraphicsitem.html#show">show</a>() and <a href="qgraphicsitem.html#setVisible">setVisible</a>().</p>
<!-- @@@hide -->
<!-- $$$hoverEnterEvent[overload1]$$$hoverEnterEventQGraphicsSceneHoverEvent* -->
<h3 class="fn" id="hoverEnterEvent"><a name="hoverEnterEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">hoverEnterEvent</span>(<span class="type"><a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for event <i>event</i>, can be reimplemented to receive hover enter events for this item. The default implementation calls <a href="qgraphicsitem.html#update">update</a>(); otherwise it does nothing.</p>
<p>Calling <a href="../qtcore/qevent.html#ignore">QEvent::ignore</a>() or <a href="../qtcore/qevent.html#accept">QEvent::accept</a>() on <i>event</i> has no effect.</p>
<p><b>See also </b><a href="qgraphicsitem.html#hoverMoveEvent">hoverMoveEvent</a>(), <a href="qgraphicsitem.html#hoverLeaveEvent">hoverLeaveEvent</a>(), <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>(), and <a href="qgraphicsitem.html#setAcceptHoverEvents">setAcceptHoverEvents</a>().</p>
<!-- @@@hoverEnterEvent -->
<!-- $$$hoverLeaveEvent[overload1]$$$hoverLeaveEventQGraphicsSceneHoverEvent* -->
<h3 class="fn" id="hoverLeaveEvent"><a name="hoverLeaveEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">hoverLeaveEvent</span>(<span class="type"><a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for event <i>event</i>, can be reimplemented to receive hover leave events for this item. The default implementation calls <a href="qgraphicsitem.html#update">update</a>(); otherwise it does nothing.</p>
<p>Calling <a href="../qtcore/qevent.html#ignore">QEvent::ignore</a>() or <a href="../qtcore/qevent.html#accept">QEvent::accept</a>() on <i>event</i> has no effect.</p>
<p><b>See also </b><a href="qgraphicsitem.html#hoverEnterEvent">hoverEnterEvent</a>(), <a href="qgraphicsitem.html#hoverMoveEvent">hoverMoveEvent</a>(), <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>(), and <a href="qgraphicsitem.html#setAcceptHoverEvents">setAcceptHoverEvents</a>().</p>
<!-- @@@hoverLeaveEvent -->
<!-- $$$hoverMoveEvent[overload1]$$$hoverMoveEventQGraphicsSceneHoverEvent* -->
<h3 class="fn" id="hoverMoveEvent"><a name="hoverMoveEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">hoverMoveEvent</span>(<span class="type"><a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for event <i>event</i>, can be reimplemented to receive hover move events for this item. The default implementation does nothing.</p>
<p>Calling <a href="../qtcore/qevent.html#ignore">QEvent::ignore</a>() or <a href="../qtcore/qevent.html#accept">QEvent::accept</a>() on <i>event</i> has no effect.</p>
<p><b>See also </b><a href="qgraphicsitem.html#hoverEnterEvent">hoverEnterEvent</a>(), <a href="qgraphicsitem.html#hoverLeaveEvent">hoverLeaveEvent</a>(), <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>(), and <a href="qgraphicsitem.html#setAcceptHoverEvents">setAcceptHoverEvents</a>().</p>
<!-- @@@hoverMoveEvent -->
<!-- $$$inputMethodEvent[overload1]$$$inputMethodEventQInputMethodEvent* -->
<h3 class="fn" id="inputMethodEvent"><a name="inputMethodEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">inputMethodEvent</span>(<span class="type"><a href="../qtgui/qinputmethodevent.html">QInputMethodEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for event <i>event</i>, can be reimplemented to receive input method events for this item. The default implementation ignores the event.</p>
<p><b>See also </b><a href="qgraphicsitem.html#inputMethodQuery">inputMethodQuery</a>() and <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<!-- @@@inputMethodEvent -->
<!-- $$$inputMethodHints[overload1]$$$inputMethodHints -->
<h3 class="fn" id="inputMethodHints"><a name="inputMethodHints"></a><span class="type"><a href="../qtcore/qt.html#InputMethodHint-enum">Qt::InputMethodHints</a></span> QGraphicsItem::<span class="name">inputMethodHints</span>() const</h3>
<p>Returns the current input method hints of this item.</p>
<p>Input method hints are only relevant for input items. The hints are used by the input method to indicate how it should operate. For example, if the Qt::ImhNumbersOnly flag is set, the input method may change its visual components to reflect that only numbers can be entered.</p>
<p>The effect may vary between input method implementations.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setInputMethodHints">setInputMethodHints</a>() and <a href="qgraphicsitem.html#inputMethodQuery">inputMethodQuery</a>().</p>
<!-- @@@inputMethodHints -->
<!-- $$$inputMethodQuery[overload1]$$$inputMethodQueryQt::InputMethodQuery -->
<h3 class="fn" id="inputMethodQuery"><a name="inputMethodQuery"></a><code>[virtual protected] </code><span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> QGraphicsItem::<span class="name">inputMethodQuery</span>(<span class="type"><a href="../qtcore/qt.html#InputMethodQuery-enum">Qt::InputMethodQuery</a></span> <i>query</i>) const</h3>
<p>This method is only relevant for input items. It is used by the input method to query a set of properties of the item to be able to support complex input method operations, such as support for surrounding text and reconversions. <i>query</i> specifies which property is queried.</p>
<p><b>See also </b><a href="qgraphicsitem.html#inputMethodEvent">inputMethodEvent</a>() and <a href="../qtgui/qinputmethodevent.html">QInputMethodEvent</a>.</p>
<!-- @@@inputMethodQuery -->
<!-- $$$installSceneEventFilter[overload1]$$$installSceneEventFilterQGraphicsItem* -->
<h3 class="fn" id="installSceneEventFilter"><a name="installSceneEventFilter"></a><span class="type">void</span> QGraphicsItem::<span class="name">installSceneEventFilter</span>(<span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>filterItem</i>)</h3>
<p>Installs an event filter for this item on <i>filterItem</i>, causing all events for this item to first pass through <i>filterItem</i>'s <a href="qgraphicsitem.html#sceneEventFilter">sceneEventFilter</a>() function.</p>
<p>To filter another item's events, install this item as an event filter for the other item. Example:</p>
<pre class="cpp">

  <span class="type"><a href="qgraphicsscene.html">QGraphicsScene</a></span> scene;
  <span class="type"><a href="qgraphicsellipseitem.html">QGraphicsEllipseItem</a></span> <span class="operator">*</span>ellipse <span class="operator">=</span> scene<span class="operator">.</span>addEllipse(<span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span>(<span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">20</span>));
  <span class="type"><a href="qgraphicslineitem.html">QGraphicsLineItem</a></span> <span class="operator">*</span>line <span class="operator">=</span> scene<span class="operator">.</span>addLine(<span class="type"><a href="../qtcore/qlinef.html">QLineF</a></span>(<span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">20</span>));

  line<span class="operator">-</span><span class="operator">&gt;</span>installSceneEventFilter(ellipse);
  <span class="comment">// line's events are filtered by ellipse's sceneEventFilter() function.</span>

  ellipse<span class="operator">-</span><span class="operator">&gt;</span>installSceneEventFilter(line);
  <span class="comment">// ellipse's events are filtered by line's sceneEventFilter() function.</span>

</pre>
<p>An item can only filter events for other items in the same scene. Also, an item cannot filter its own events; instead, you can reimplement <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>() directly.</p>
<p>Items must belong to a scene for scene event filters to be installed and used.</p>
<p><b>See also </b><a href="qgraphicsitem.html#removeSceneEventFilter">removeSceneEventFilter</a>(), <a href="qgraphicsitem.html#sceneEventFilter">sceneEventFilter</a>(), and <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<!-- @@@installSceneEventFilter -->
<!-- $$$isActive[overload1]$$$isActive -->
<h3 class="fn" id="isActive"><a name="isActive"></a><span class="type">bool</span> QGraphicsItem::<span class="name">isActive</span>() const</h3>
<p>Returns <code>true</code> if this item is active; otherwise returns <code>false</code>.</p>
<p>An item can only be active if the scene is active. An item is active if it is, or is a descendent of, an active panel. Items in non-active panels are not active.</p>
<p>Items that are not part of a panel follow scene activation when the scene has no active panel.</p>
<p>Only active items can gain input focus.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsscene.html#isActive">QGraphicsScene::isActive</a>(), <a href="qgraphicsscene.html#activePanel">QGraphicsScene::activePanel</a>(), <a href="qgraphicsitem.html#panel">panel</a>(), and <a href="qgraphicsitem.html#isPanel">isPanel</a>().</p>
<!-- @@@isActive -->
<!-- $$$isAncestorOf[overload1]$$$isAncestorOfconstQGraphicsItem* -->
<h3 class="fn" id="isAncestorOf"><a name="isAncestorOf"></a><span class="type">bool</span> QGraphicsItem::<span class="name">isAncestorOf</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>child</i>) const</h3>
<p>Returns <code>true</code> if this item is an ancestor of <i>child</i> (i.e&#x2e;, if this item is <i>child</i>'s parent, or one of <i>child</i>'s parent's ancestors).</p>
<p><b>See also </b><a href="qgraphicsitem.html#parentItem">parentItem</a>().</p>
<!-- @@@isAncestorOf -->
<!-- $$$isBlockedByModalPanel[overload1]$$$isBlockedByModalPanelQGraphicsItem** -->
<h3 class="fn" id="isBlockedByModalPanel"><a name="isBlockedByModalPanel"></a><span class="type">bool</span> QGraphicsItem::<span class="name">isBlockedByModalPanel</span>(<span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> **<i>blockingPanel</i> = Q_NULLPTR) const</h3>
<p>Returns <code>true</code> if this item is blocked by a modal panel, false otherwise. If <i>blockingPanel</i> is non-zero, <i>blockingPanel</i> will be set to the modal panel that is blocking this item. If this item is not blocked, <i>blockingPanel</i> will not be set by this function.</p>
<p>This function always returns <code>false</code> for items not in a scene.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#panelModality">panelModality</a>(), <a href="qgraphicsitem.html#setPanelModality">setPanelModality</a>(), and <a href="qgraphicsitem.html#PanelModality-enum">PanelModality</a>.</p>
<!-- @@@isBlockedByModalPanel -->
<!-- $$$isClipped[overload1]$$$isClipped -->
<h3 class="fn" id="isClipped"><a name="isClipped"></a><span class="type">bool</span> QGraphicsItem::<span class="name">isClipped</span>() const</h3>
<p>Returns <code>true</code> if this item is clipped. An item is clipped if it has either set the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemClipsToShape</a> flag, or if it or any of its ancestors has set the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemClipsChildrenToShape</a> flag.</p>
<p>Clipping affects the item's appearance (i.e&#x2e;, painting), as well as mouse and hover event delivery.</p>
<p><b>See also </b><a href="qgraphicsitem.html#clipPath">clipPath</a>(), <a href="qgraphicsitem.html#shape">shape</a>(), and <a href="qgraphicsitem.html#setFlags">setFlags</a>().</p>
<!-- @@@isClipped -->
<!-- $$$isEnabled[overload1]$$$isEnabled -->
<h3 class="fn" id="isEnabled"><a name="isEnabled"></a><span class="type">bool</span> QGraphicsItem::<span class="name">isEnabled</span>() const</h3>
<p>Returns <code>true</code> if the item is enabled; otherwise, false is returned.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setEnabled">setEnabled</a>().</p>
<!-- @@@isEnabled -->
<!-- $$$isObscured[overload1]$$$isObscuredconstQRectF& -->
<h3 class="fn" id="isObscured"><a name="isObscured"></a><span class="type">bool</span> QGraphicsItem::<span class="name">isObscured</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i> = QRectF()) const</h3>
<p>This is an overloaded function.</p>
<p>Returns <code>true</code> if <i>rect</i> is completely obscured by the opaque shape of any of colliding items above it (i.e&#x2e;, with a higher Z value than this item).</p>
<p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="qgraphicsitem.html#opaqueArea">opaqueArea</a>().</p>
<!-- @@@isObscured -->
<!-- $$$isObscured$$$isObscuredqrealqrealqrealqreal -->
<h3 class="fn" id="isObscured-1"><a name="isObscured-1"></a><span class="type">bool</span> QGraphicsItem::<span class="name">isObscured</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>) const</h3>
<p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#isObscured">isObscured</a>(<a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in  Qt 4.3.</p>
<!-- @@@isObscured -->
<!-- $$$isObscuredBy[overload1]$$$isObscuredByconstQGraphicsItem* -->
<h3 class="fn" id="isObscuredBy"><a name="isObscuredBy"></a><code>[virtual] </code><span class="type">bool</span> QGraphicsItem::<span class="name">isObscuredBy</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>) const</h3>
<p>Returns <code>true</code> if this item's bounding rect is completely obscured by the opaque shape of <i>item</i>.</p>
<p>The base implementation maps <i>item</i>'s <a href="qgraphicsitem.html#opaqueArea">opaqueArea</a>() to this item's coordinate system, and then checks if this item's <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() is fully contained within the mapped shape.</p>
<p>You can reimplement this function to provide a custom algorithm for determining whether this item is obscured by <i>item</i>.</p>
<p><b>See also </b><a href="qgraphicsitem.html#opaqueArea">opaqueArea</a>() and <a href="qgraphicsitem.html#isObscured">isObscured</a>().</p>
<!-- @@@isObscuredBy -->
<!-- $$$isPanel[overload1]$$$isPanel -->
<h3 class="fn" id="isPanel"><a name="isPanel"></a><span class="type">bool</span> QGraphicsItem::<span class="name">isPanel</span>() const</h3>
<p>Returns <code>true</code> if the item is a panel; otherwise returns <code>false</code>.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#panel">QGraphicsItem::panel</a>() and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsPanel</a>.</p>
<!-- @@@isPanel -->
<!-- $$$isSelected[overload1]$$$isSelected -->
<h3 class="fn" id="isSelected"><a name="isSelected"></a><span class="type">bool</span> QGraphicsItem::<span class="name">isSelected</span>() const</h3>
<p>Returns <code>true</code> if this item is selected; otherwise, false is returned.</p>
<p>Items that are in a group inherit the group's selected state.</p>
<p>Items are not selected by default.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setSelected">setSelected</a>() and <a href="qgraphicsscene.html#setSelectionArea">QGraphicsScene::setSelectionArea</a>().</p>
<!-- @@@isSelected -->
<!-- $$$isUnderMouse[overload1]$$$isUnderMouse -->
<h3 class="fn" id="isUnderMouse"><a name="isUnderMouse"></a><span class="type">bool</span> QGraphicsItem::<span class="name">isUnderMouse</span>() const</h3>
<p>Returns <code>true</code> if this item is currently under the mouse cursor in one of the views; otherwise, false is returned.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsscene.html#views">QGraphicsScene::views</a>() and <a href="../qtgui/qcursor.html#pos">QCursor::pos</a>().</p>
<!-- @@@isUnderMouse -->
<!-- $$$isVisible[overload1]$$$isVisible -->
<h3 class="fn" id="isVisible"><a name="isVisible"></a><span class="type">bool</span> QGraphicsItem::<span class="name">isVisible</span>() const</h3>
<p>Returns <code>true</code> if the item is visible; otherwise, false is returned.</p>
<p>Note that the item's general visibility is unrelated to whether or not it is actually being visualized by a <a href="qgraphicsview.html">QGraphicsView</a>.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setVisible">setVisible</a>().</p>
<!-- @@@isVisible -->
<!-- $$$isVisibleTo[overload1]$$$isVisibleToconstQGraphicsItem* -->
<h3 class="fn" id="isVisibleTo"><a name="isVisibleTo"></a><span class="type">bool</span> QGraphicsItem::<span class="name">isVisibleTo</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>parent</i>) const</h3>
<p>Returns <code>true</code> if the item is visible to <i>parent</i>; otherwise, false is returned. <i>parent</i> can be 0, in which case this function will return whether the item is visible to the scene or not.</p>
<p>An item may not be visible to its ancestors even if <a href="qgraphicsitem.html#isVisible">isVisible</a>() is true. It may also be visible to its ancestors even if <a href="qgraphicsitem.html#isVisible">isVisible</a>() is false. If any ancestor is hidden, the item itself will be implicitly hidden, in which case this function will return false.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsitem.html#isVisible">isVisible</a>() and <a href="qgraphicsitem.html#setVisible">setVisible</a>().</p>
<!-- @@@isVisibleTo -->
<!-- $$$isWidget[overload1]$$$isWidget -->
<h3 class="fn" id="isWidget"><a name="isWidget"></a><span class="type">bool</span> QGraphicsItem::<span class="name">isWidget</span>() const</h3>
<p>Returns <code>true</code> if this item is a widget (i.e&#x2e;, <a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a>); otherwise, returns <code>false</code>.</p>
<p>This function was introduced in  Qt 4.4.</p>
<!-- @@@isWidget -->
<!-- $$$isWindow[overload1]$$$isWindow -->
<h3 class="fn" id="isWindow"><a name="isWindow"></a><span class="type">bool</span> QGraphicsItem::<span class="name">isWindow</span>() const</h3>
<p>Returns <code>true</code> if the item is a <a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> window, otherwise returns false.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicswidget.html#windowFlags-prop">QGraphicsWidget::windowFlags</a>().</p>
<!-- @@@isWindow -->
<!-- $$$itemChange[overload1]$$$itemChangeGraphicsItemChangeconstQVariant& -->
<h3 class="fn" id="itemChange"><a name="itemChange"></a><code>[virtual protected] </code><span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> QGraphicsItem::<span class="name">itemChange</span>(<span class="type"><a href="qgraphicsitem.html#GraphicsItemChange-enum">GraphicsItemChange</a></span> <i>change</i>, const <span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> &amp;<i>value</i>)</h3>
<p>This virtual function is called by <a href="qgraphicsitem.html">QGraphicsItem</a> to notify custom items that some part of the item's state changes. By reimplementing this function, you can react to a change, and in some cases (depending on <i>change</i>), adjustments can be made.</p>
<p><i>change</i> is the parameter of the item that is changing. <i>value</i> is the new value; the type of the value depends on <i>change</i>.</p>
<p>Example:</p>
<pre class="cpp">

  <span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> Component<span class="operator">::</span>itemChange(GraphicsItemChange change<span class="operator">,</span> <span class="keyword">const</span> <span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> <span class="operator">&amp;</span>value)
  {
      <span class="keyword">if</span> (change <span class="operator">=</span><span class="operator">=</span> ItemPositionChange <span class="operator">&amp;</span><span class="operator">&amp;</span> scene()) {
          <span class="comment">// value is the new position.</span>
          <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> newPos <span class="operator">=</span> value<span class="operator">.</span>toPointF();
          <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> rect <span class="operator">=</span> scene()<span class="operator">-</span><span class="operator">&gt;</span>sceneRect();
          <span class="keyword">if</span> (<span class="operator">!</span>rect<span class="operator">.</span>contains(newPos)) {
              <span class="comment">// Keep the item inside the scene rect.</span>
              newPos<span class="operator">.</span>setX(<a href="../qtcore/qtglobal.html#qMin">qMin</a>(rect<span class="operator">.</span>right()<span class="operator">,</span> <a href="../qtcore/qtglobal.html#qMax">qMax</a>(newPos<span class="operator">.</span>x()<span class="operator">,</span> rect<span class="operator">.</span>left())));
              newPos<span class="operator">.</span>setY(<a href="../qtcore/qtglobal.html#qMin">qMin</a>(rect<span class="operator">.</span>bottom()<span class="operator">,</span> <a href="../qtcore/qtglobal.html#qMax">qMax</a>(newPos<span class="operator">.</span>y()<span class="operator">,</span> rect<span class="operator">.</span>top())));
              <span class="keyword">return</span> newPos;
          }
      }
      <span class="keyword">return</span> <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span><span class="operator">::</span>itemChange(change<span class="operator">,</span> value);
  }

</pre>
<p>The default implementation does nothing, and returns <i>value</i>.</p>
<p>Note: Certain <a href="qgraphicsitem.html">QGraphicsItem</a> functions cannot be called in a reimplementation of this function; see the <a href="qgraphicsitem.html#GraphicsItemChange-enum">GraphicsItemChange</a> documentation for details.</p>
<p><b>See also </b><a href="qgraphicsitem.html#GraphicsItemChange-enum">GraphicsItemChange</a>.</p>
<!-- @@@itemChange -->
<!-- $$$itemTransform[overload1]$$$itemTransformconstQGraphicsItem*bool* -->
<h3 class="fn" id="itemTransform"><a name="itemTransform"></a><span class="type"><a href="../qtgui/qtransform.html">QTransform</a></span> QGraphicsItem::<span class="name">itemTransform</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>other</i>, <span class="type">bool</span> *<i>ok</i> = Q_NULLPTR) const</h3>
<p>Returns a <a href="../qtgui/qtransform.html">QTransform</a> that maps coordinates from this item to <i>other</i>. If <i>ok</i> is not null, and if there is no such transform, the boolean pointed to by <i>ok</i> will be set to false; otherwise it will be set to true.</p>
<p>This transform provides an alternative to the <a href="qgraphicsitem.html#mapToItem">mapToItem</a>() or <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>() functions, by returning the appropriate transform so that you can map shapes and coordinates yourself. It also helps you write more efficient code when repeatedly mapping between the same two items.</p>
<p><b>Note: </b>In rare circumstances, there is no transform that maps between two items.</p><p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="qgraphicsitem.html#deviceTransform">deviceTransform</a>().</p>
<!-- @@@itemTransform -->
<!-- $$$keyPressEvent[overload1]$$$keyPressEventQKeyEvent* -->
<h3 class="fn" id="keyPressEvent"><a name="keyPressEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">keyPressEvent</span>(<span class="type"><a href="../qtgui/qkeyevent.html">QKeyEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for event <i>event</i>, can be reimplemented to receive key press events for this item. The default implementation ignores the event. If you reimplement this handler, the event will by default be accepted.</p>
<p>Note that key events are only received for items that set the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a> flag, and that have keyboard input focus.</p>
<p><b>See also </b><a href="qgraphicsitem.html#keyReleaseEvent">keyReleaseEvent</a>(), <a href="qgraphicsitem.html#setFocus">setFocus</a>(), <a href="qgraphicsscene.html#setFocusItem">QGraphicsScene::setFocusItem</a>(), and <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<!-- @@@keyPressEvent -->
<!-- $$$keyReleaseEvent[overload1]$$$keyReleaseEventQKeyEvent* -->
<h3 class="fn" id="keyReleaseEvent"><a name="keyReleaseEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">keyReleaseEvent</span>(<span class="type"><a href="../qtgui/qkeyevent.html">QKeyEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for event <i>event</i>, can be reimplemented to receive key release events for this item. The default implementation ignores the event. If you reimplement this handler, the event will by default be accepted.</p>
<p>Note that key events are only received for items that set the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a> flag, and that have keyboard input focus.</p>
<p><b>See also </b><a href="qgraphicsitem.html#keyPressEvent">keyPressEvent</a>(), <a href="qgraphicsitem.html#setFocus">setFocus</a>(), <a href="qgraphicsscene.html#setFocusItem">QGraphicsScene::setFocusItem</a>(), and <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<!-- @@@keyReleaseEvent -->
<!-- $$$mapFromItem[overload1]$$$mapFromItemconstQGraphicsItem*constQPointF& -->
<h3 class="fn" id="mapFromItem"><a name="mapFromItem"></a><span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> QGraphicsItem::<span class="name">mapFromItem</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>, const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>point</i>) const</h3>
<p>Maps the point <i>point</i>, which is in <i>item</i>'s coordinate system, to this item's coordinate system, and returns the mapped coordinate.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>().</p>
<p><b>See also </b><a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapFromItem -->
<!-- $$$mapFromItem$$$mapFromItemconstQGraphicsItem*constQRectF& -->
<h3 class="fn" id="mapFromItem-1"><a name="mapFromItem-1"></a><span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> QGraphicsItem::<span class="name">mapFromItem</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>, const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>) const</h3>
<p>Maps the rectangle <i>rect</i>, which is in <i>item</i>'s coordinate system, to this item's coordinate system, and returns the mapped rectangle as a polygon.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>()</p>
<p><b>See also </b><a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapFromItem -->
<!-- $$$mapFromItem$$$mapFromItemconstQGraphicsItem*constQPolygonF& -->
<h3 class="fn" id="mapFromItem-2"><a name="mapFromItem-2"></a><span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> QGraphicsItem::<span class="name">mapFromItem</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>, const <span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> &amp;<i>polygon</i>) const</h3>
<p>Maps the polygon <i>polygon</i>, which is in <i>item</i>'s coordinate system, to this item's coordinate system, and returns the mapped polygon.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>().</p>
<p><b>See also </b><a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapFromItem -->
<!-- $$$mapFromItem$$$mapFromItemconstQGraphicsItem*constQPainterPath& -->
<h3 class="fn" id="mapFromItem-3"><a name="mapFromItem-3"></a><span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> QGraphicsItem::<span class="name">mapFromItem</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>, const <span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> &amp;<i>path</i>) const</h3>
<p>Maps the path <i>path</i>, which is in <i>item</i>'s coordinate system, to this item's coordinate system, and returns the mapped path.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>().</p>
<p><b>See also </b><a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapFromItem -->
<!-- $$$mapFromItem$$$mapFromItemconstQGraphicsItem*qrealqreal -->
<h3 class="fn" id="mapFromItem-4"><a name="mapFromItem-4"></a><span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> QGraphicsItem::<span class="name">mapFromItem</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>) const</h3>
<p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(<i>item</i>, <a href="../qtcore/qpointf.html">QPointF</a>(<i>x</i>, <i>y</i>)).</p>
<!-- @@@mapFromItem -->
<!-- $$$mapFromItem$$$mapFromItemconstQGraphicsItem*qrealqrealqrealqreal -->
<h3 class="fn" id="mapFromItem-5"><a name="mapFromItem-5"></a><span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> QGraphicsItem::<span class="name">mapFromItem</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>) const</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(item, <a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in  Qt 4.3.</p>
<!-- @@@mapFromItem -->
<!-- $$$mapFromParent[overload1]$$$mapFromParentconstQPointF& -->
<h3 class="fn" id="mapFromParent"><a name="mapFromParent"></a><span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> QGraphicsItem::<span class="name">mapFromParent</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>point</i>) const</h3>
<p>Maps the point <i>point</i>, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped coordinate.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapFromParent -->
<!-- $$$mapFromParent$$$mapFromParentconstQRectF& -->
<h3 class="fn" id="mapFromParent-1"><a name="mapFromParent-1"></a><span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> QGraphicsItem::<span class="name">mapFromParent</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>) const</h3>
<p>Maps the rectangle <i>rect</i>, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a polygon.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapFromParent -->
<!-- $$$mapFromParent$$$mapFromParentconstQPolygonF& -->
<h3 class="fn" id="mapFromParent-2"><a name="mapFromParent-2"></a><span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> QGraphicsItem::<span class="name">mapFromParent</span>(const <span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> &amp;<i>polygon</i>) const</h3>
<p>Maps the polygon <i>polygon</i>, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped polygon.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapFromParent -->
<!-- $$$mapFromParent$$$mapFromParentconstQPainterPath& -->
<h3 class="fn" id="mapFromParent-3"><a name="mapFromParent-3"></a><span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> QGraphicsItem::<span class="name">mapFromParent</span>(const <span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> &amp;<i>path</i>) const</h3>
<p>Maps the path <i>path</i>, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped path.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapFromParent -->
<!-- $$$mapFromParent$$$mapFromParentqrealqreal -->
<h3 class="fn" id="mapFromParent-4"><a name="mapFromParent-4"></a><span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> QGraphicsItem::<span class="name">mapFromParent</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>) const</h3>
<p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(<a href="../qtcore/qpointf.html">QPointF</a>(<i>x</i>, <i>y</i>)).</p>
<!-- @@@mapFromParent -->
<!-- $$$mapFromParent$$$mapFromParentqrealqrealqrealqreal -->
<h3 class="fn" id="mapFromParent-5"><a name="mapFromParent-5"></a><span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> QGraphicsItem::<span class="name">mapFromParent</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>) const</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(<a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in  Qt 4.3.</p>
<!-- @@@mapFromParent -->
<!-- $$$mapFromScene[overload1]$$$mapFromSceneconstQPointF& -->
<h3 class="fn" id="mapFromScene"><a name="mapFromScene"></a><span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> QGraphicsItem::<span class="name">mapFromScene</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>point</i>) const</h3>
<p>Maps the point <i>point</i>, which is in this item's scene's coordinate system, to this item's coordinate system, and returns the mapped coordinate.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapFromScene -->
<!-- $$$mapFromScene$$$mapFromSceneconstQRectF& -->
<h3 class="fn" id="mapFromScene-1"><a name="mapFromScene-1"></a><span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> QGraphicsItem::<span class="name">mapFromScene</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>) const</h3>
<p>Maps the rectangle <i>rect</i>, which is in this item's scene's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a polygon.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapFromScene -->
<!-- $$$mapFromScene$$$mapFromSceneconstQPolygonF& -->
<h3 class="fn" id="mapFromScene-2"><a name="mapFromScene-2"></a><span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> QGraphicsItem::<span class="name">mapFromScene</span>(const <span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> &amp;<i>polygon</i>) const</h3>
<p>Maps the polygon <i>polygon</i>, which is in this item's scene's coordinate system, to this item's coordinate system, and returns the mapped polygon.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapFromScene -->
<!-- $$$mapFromScene$$$mapFromSceneconstQPainterPath& -->
<h3 class="fn" id="mapFromScene-3"><a name="mapFromScene-3"></a><span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> QGraphicsItem::<span class="name">mapFromScene</span>(const <span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> &amp;<i>path</i>) const</h3>
<p>Maps the path <i>path</i>, which is in this item's scene's coordinate system, to this item's coordinate system, and returns the mapped path.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapFromScene -->
<!-- $$$mapFromScene$$$mapFromSceneqrealqreal -->
<h3 class="fn" id="mapFromScene-4"><a name="mapFromScene-4"></a><span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> QGraphicsItem::<span class="name">mapFromScene</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>) const</h3>
<p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(<a href="../qtcore/qpointf.html">QPointF</a>(<i>x</i>, <i>y</i>)).</p>
<!-- @@@mapFromScene -->
<!-- $$$mapFromScene$$$mapFromSceneqrealqrealqrealqreal -->
<h3 class="fn" id="mapFromScene-5"><a name="mapFromScene-5"></a><span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> QGraphicsItem::<span class="name">mapFromScene</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>) const</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(<a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in  Qt 4.3.</p>
<!-- @@@mapFromScene -->
<!-- $$$mapRectFromItem[overload1]$$$mapRectFromItemconstQGraphicsItem*constQRectF& -->
<h3 class="fn" id="mapRectFromItem"><a name="mapRectFromItem"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsItem::<span class="name">mapRectFromItem</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>, const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>) const</h3>
<p>Maps the rectangle <i>rect</i>, which is in <i>item</i>'s coordinate system, to this item's coordinate system, and returns the mapped rectangle as a new rectangle (i.e&#x2e;, the bounding rectangle of the resulting polygon).</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapRectFromScene">mapRectFromScene</a>().</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapRectFromItem -->
<!-- $$$mapRectFromItem$$$mapRectFromItemconstQGraphicsItem*qrealqrealqrealqreal -->
<h3 class="fn" id="mapRectFromItem-1"><a name="mapRectFromItem-1"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsItem::<span class="name">mapRectFromItem</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>) const</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#mapRectFromItem">mapRectFromItem</a>(item, <a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in  Qt 4.5.</p>
<!-- @@@mapRectFromItem -->
<!-- $$$mapRectFromParent[overload1]$$$mapRectFromParentconstQRectF& -->
<h3 class="fn" id="mapRectFromParent"><a name="mapRectFromParent"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsItem::<span class="name">mapRectFromParent</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>) const</h3>
<p>Maps the rectangle <i>rect</i>, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a new rectangle (i.e&#x2e;, the bounding rectangle of the resulting polygon).</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapRectFromParent -->
<!-- $$$mapRectFromParent$$$mapRectFromParentqrealqrealqrealqreal -->
<h3 class="fn" id="mapRectFromParent-1"><a name="mapRectFromParent-1"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsItem::<span class="name">mapRectFromParent</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>) const</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#mapRectFromParent">mapRectFromParent</a>(<a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in  Qt 4.5.</p>
<!-- @@@mapRectFromParent -->
<!-- $$$mapRectFromScene[overload1]$$$mapRectFromSceneconstQRectF& -->
<h3 class="fn" id="mapRectFromScene"><a name="mapRectFromScene"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsItem::<span class="name">mapRectFromScene</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>) const</h3>
<p>Maps the rectangle <i>rect</i>, which is in scene coordinates, to this item's coordinate system, and returns the mapped rectangle as a new rectangle (i.e&#x2e;, the bounding rectangle of the resulting polygon).</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapRectFromScene -->
<!-- $$$mapRectFromScene$$$mapRectFromSceneqrealqrealqrealqreal -->
<h3 class="fn" id="mapRectFromScene-1"><a name="mapRectFromScene-1"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsItem::<span class="name">mapRectFromScene</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>) const</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#mapRectFromScene">mapRectFromScene</a>(<a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in  Qt 4.5.</p>
<!-- @@@mapRectFromScene -->
<!-- $$$mapRectToItem[overload1]$$$mapRectToItemconstQGraphicsItem*constQRectF& -->
<h3 class="fn" id="mapRectToItem"><a name="mapRectToItem"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsItem::<span class="name">mapRectToItem</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>, const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>) const</h3>
<p>Maps the rectangle <i>rect</i>, which is in this item's coordinate system, to <i>item</i>'s coordinate system, and returns the mapped rectangle as a new rectangle (i.e&#x2e;, the bounding rectangle of the resulting polygon).</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapRectToScene">mapRectToScene</a>().</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapRectToItem -->
<!-- $$$mapRectToItem$$$mapRectToItemconstQGraphicsItem*qrealqrealqrealqreal -->
<h3 class="fn" id="mapRectToItem-1"><a name="mapRectToItem-1"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsItem::<span class="name">mapRectToItem</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>) const</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#mapRectToItem">mapRectToItem</a>(item, <a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in  Qt 4.5.</p>
<!-- @@@mapRectToItem -->
<!-- $$$mapRectToParent[overload1]$$$mapRectToParentconstQRectF& -->
<h3 class="fn" id="mapRectToParent"><a name="mapRectToParent"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsItem::<span class="name">mapRectToParent</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>) const</h3>
<p>Maps the rectangle <i>rect</i>, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped rectangle as a new rectangle (i.e&#x2e;, the bounding rectangle of the resulting polygon).</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapRectToParent -->
<!-- $$$mapRectToParent$$$mapRectToParentqrealqrealqrealqreal -->
<h3 class="fn" id="mapRectToParent-1"><a name="mapRectToParent-1"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsItem::<span class="name">mapRectToParent</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>) const</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#mapRectToParent">mapRectToParent</a>(<a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in  Qt 4.5.</p>
<!-- @@@mapRectToParent -->
<!-- $$$mapRectToScene[overload1]$$$mapRectToSceneconstQRectF& -->
<h3 class="fn" id="mapRectToScene"><a name="mapRectToScene"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsItem::<span class="name">mapRectToScene</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>) const</h3>
<p>Maps the rectangle <i>rect</i>, which is in this item's coordinate system, to the scene coordinate system, and returns the mapped rectangle as a new rectangle (i.e&#x2e;, the bounding rectangle of the resulting polygon).</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapRectToScene -->
<!-- $$$mapRectToScene$$$mapRectToSceneqrealqrealqrealqreal -->
<h3 class="fn" id="mapRectToScene-1"><a name="mapRectToScene-1"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsItem::<span class="name">mapRectToScene</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>) const</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#mapRectToScene">mapRectToScene</a>(<a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in  Qt 4.5.</p>
<!-- @@@mapRectToScene -->
<!-- $$$mapToItem[overload1]$$$mapToItemconstQGraphicsItem*constQPointF& -->
<h3 class="fn" id="mapToItem"><a name="mapToItem"></a><span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> QGraphicsItem::<span class="name">mapToItem</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>, const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>point</i>) const</h3>
<p>Maps the point <i>point</i>, which is in this item's coordinate system, to <i>item</i>'s coordinate system, and returns the mapped coordinate.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapToScene">mapToScene</a>().</p>
<p><b>See also </b><a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapToItem -->
<!-- $$$mapToItem$$$mapToItemconstQGraphicsItem*constQRectF& -->
<h3 class="fn" id="mapToItem-1"><a name="mapToItem-1"></a><span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> QGraphicsItem::<span class="name">mapToItem</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>, const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>) const</h3>
<p>Maps the rectangle <i>rect</i>, which is in this item's coordinate system, to <i>item</i>'s coordinate system, and returns the mapped rectangle as a polygon.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapToScene">mapToScene</a>().</p>
<p><b>See also </b><a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapToItem -->
<!-- $$$mapToItem$$$mapToItemconstQGraphicsItem*constQPolygonF& -->
<h3 class="fn" id="mapToItem-2"><a name="mapToItem-2"></a><span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> QGraphicsItem::<span class="name">mapToItem</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>, const <span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> &amp;<i>polygon</i>) const</h3>
<p>Maps the polygon <i>polygon</i>, which is in this item's coordinate system, to <i>item</i>'s coordinate system, and returns the mapped polygon.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapToScene">mapToScene</a>().</p>
<p><b>See also </b><a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapToItem -->
<!-- $$$mapToItem$$$mapToItemconstQGraphicsItem*constQPainterPath& -->
<h3 class="fn" id="mapToItem-3"><a name="mapToItem-3"></a><span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> QGraphicsItem::<span class="name">mapToItem</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>, const <span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> &amp;<i>path</i>) const</h3>
<p>Maps the path <i>path</i>, which is in this item's coordinate system, to <i>item</i>'s coordinate system, and returns the mapped path.</p>
<p>If <i>item</i> is 0, this function returns the same as <a href="qgraphicsitem.html#mapToScene">mapToScene</a>().</p>
<p><b>See also </b><a href="qgraphicsitem.html#itemTransform">itemTransform</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapFromItem">mapFromItem</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapToItem -->
<!-- $$$mapToItem$$$mapToItemconstQGraphicsItem*qrealqreal -->
<h3 class="fn" id="mapToItem-4"><a name="mapToItem-4"></a><span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> QGraphicsItem::<span class="name">mapToItem</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>) const</h3>
<p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(<i>item</i>, <a href="../qtcore/qpointf.html">QPointF</a>(<i>x</i>, <i>y</i>)).</p>
<!-- @@@mapToItem -->
<!-- $$$mapToItem$$$mapToItemconstQGraphicsItem*qrealqrealqrealqreal -->
<h3 class="fn" id="mapToItem-5"><a name="mapToItem-5"></a><span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> QGraphicsItem::<span class="name">mapToItem</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>) const</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(item, <a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in  Qt 4.3.</p>
<!-- @@@mapToItem -->
<!-- $$$mapToParent[overload1]$$$mapToParentconstQPointF& -->
<h3 class="fn" id="mapToParent"><a name="mapToParent"></a><span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> QGraphicsItem::<span class="name">mapToParent</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>point</i>) const</h3>
<p>Maps the point <i>point</i>, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped coordinate. If the item has no parent, <i>point</i> will be mapped to the scene's coordinate system.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapToParent -->
<!-- $$$mapToParent$$$mapToParentconstQRectF& -->
<h3 class="fn" id="mapToParent-1"><a name="mapToParent-1"></a><span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> QGraphicsItem::<span class="name">mapToParent</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>) const</h3>
<p>Maps the rectangle <i>rect</i>, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped rectangle as a polygon. If the item has no parent, <i>rect</i> will be mapped to the scene's coordinate system.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapToParent -->
<!-- $$$mapToParent$$$mapToParentconstQPolygonF& -->
<h3 class="fn" id="mapToParent-2"><a name="mapToParent-2"></a><span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> QGraphicsItem::<span class="name">mapToParent</span>(const <span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> &amp;<i>polygon</i>) const</h3>
<p>Maps the polygon <i>polygon</i>, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped polygon. If the item has no parent, <i>polygon</i> will be mapped to the scene's coordinate system.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapToParent -->
<!-- $$$mapToParent$$$mapToParentconstQPainterPath& -->
<h3 class="fn" id="mapToParent-3"><a name="mapToParent-3"></a><span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> QGraphicsItem::<span class="name">mapToParent</span>(const <span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> &amp;<i>path</i>) const</h3>
<p>Maps the path <i>path</i>, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped path. If the item has no parent, <i>path</i> will be mapped to the scene's coordinate system.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mapToScene">mapToScene</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromParent">mapFromParent</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapToParent -->
<!-- $$$mapToParent$$$mapToParentqrealqreal -->
<h3 class="fn" id="mapToParent-4"><a name="mapToParent-4"></a><span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> QGraphicsItem::<span class="name">mapToParent</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>) const</h3>
<p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(<a href="../qtcore/qpointf.html">QPointF</a>(<i>x</i>, <i>y</i>)).</p>
<!-- @@@mapToParent -->
<!-- $$$mapToParent$$$mapToParentqrealqrealqrealqreal -->
<h3 class="fn" id="mapToParent-5"><a name="mapToParent-5"></a><span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> QGraphicsItem::<span class="name">mapToParent</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>) const</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(<a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in  Qt 4.3.</p>
<!-- @@@mapToParent -->
<!-- $$$mapToScene[overload1]$$$mapToSceneconstQPointF& -->
<h3 class="fn" id="mapToScene"><a name="mapToScene"></a><span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> QGraphicsItem::<span class="name">mapToScene</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>point</i>) const</h3>
<p>Maps the point <i>point</i>, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped coordinate.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapToScene -->
<!-- $$$mapToScene$$$mapToSceneconstQRectF& -->
<h3 class="fn" id="mapToScene-1"><a name="mapToScene-1"></a><span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> QGraphicsItem::<span class="name">mapToScene</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>) const</h3>
<p>Maps the rectangle <i>rect</i>, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped rectangle as a polygon.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapToScene -->
<!-- $$$mapToScene$$$mapToSceneconstQPolygonF& -->
<h3 class="fn" id="mapToScene-2"><a name="mapToScene-2"></a><span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> QGraphicsItem::<span class="name">mapToScene</span>(const <span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> &amp;<i>polygon</i>) const</h3>
<p>Maps the polygon <i>polygon</i>, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped polygon.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapToScene -->
<!-- $$$mapToScene$$$mapToSceneconstQPainterPath& -->
<h3 class="fn" id="mapToScene-3"><a name="mapToScene-3"></a><span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> QGraphicsItem::<span class="name">mapToScene</span>(const <span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> &amp;<i>path</i>) const</h3>
<p>Maps the path <i>path</i>, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped path.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mapToParent">mapToParent</a>(), <a href="qgraphicsitem.html#mapToItem">mapToItem</a>(), <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@mapToScene -->
<!-- $$$mapToScene$$$mapToSceneqrealqreal -->
<h3 class="fn" id="mapToScene-4"><a name="mapToScene-4"></a><span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> QGraphicsItem::<span class="name">mapToScene</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>) const</h3>
<p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(<a href="../qtcore/qpointf.html">QPointF</a>(<i>x</i>, <i>y</i>)).</p>
<!-- @@@mapToScene -->
<!-- $$$mapToScene$$$mapToSceneqrealqrealqrealqreal -->
<h3 class="fn" id="mapToScene-5"><a name="mapToScene-5"></a><span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> QGraphicsItem::<span class="name">mapToScene</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>) const</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#mapToScene">mapToScene</a>(<a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p>This function was introduced in  Qt 4.3.</p>
<!-- @@@mapToScene -->
<!-- $$$mouseDoubleClickEvent[overload1]$$$mouseDoubleClickEventQGraphicsSceneMouseEvent* -->
<h3 class="fn" id="mouseDoubleClickEvent"><a name="mouseDoubleClickEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">mouseDoubleClickEvent</span>(<span class="type"><a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for event <i>event</i>, can be reimplemented to receive mouse doubleclick events for this item.</p>
<p>When doubleclicking an item, the item will first receive a mouse press event, followed by a release event (i.e&#x2e;, a click), then a doubleclick event, and finally a release event.</p>
<p>Calling <a href="../qtcore/qevent.html#ignore">QEvent::ignore</a>() or <a href="../qtcore/qevent.html#accept">QEvent::accept</a>() on <i>event</i> has no effect.</p>
<p>The default implementation calls <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>(). If you want to keep the base implementation when reimplementing this function, call QGraphicsItem::mouseDoubleClickEvent() in your reimplementation.</p>
<p>Note that an item will not receive double click events if it is neither <a href="qgraphicsitem.html#GraphicsItemFlag-enum">selectable</a> nor <a href="qgraphicsitem.html#GraphicsItemFlag-enum">movable</a> (single mouse clicks are ignored in this case, and that stops the generation of double clicks).</p>
<p><b>See also </b><a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>(), <a href="qgraphicsitem.html#mouseMoveEvent">mouseMoveEvent</a>(), <a href="qgraphicsitem.html#mouseReleaseEvent">mouseReleaseEvent</a>(), and <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<!-- @@@mouseDoubleClickEvent -->
<!-- $$$mouseMoveEvent[overload1]$$$mouseMoveEventQGraphicsSceneMouseEvent* -->
<h3 class="fn" id="mouseMoveEvent"><a name="mouseMoveEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">mouseMoveEvent</span>(<span class="type"><a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for event <i>event</i>, can be reimplemented to receive mouse move events for this item. If you do receive this event, you can be certain that this item also received a mouse press event, and that this item is the current mouse grabber.</p>
<p>Calling <a href="../qtcore/qevent.html#ignore">QEvent::ignore</a>() or <a href="../qtcore/qevent.html#accept">QEvent::accept</a>() on <i>event</i> has no effect.</p>
<p>The default implementation handles basic item interaction, such as selection and moving. If you want to keep the base implementation when reimplementing this function, call QGraphicsItem::mouseMoveEvent() in your reimplementation.</p>
<p>Please note that <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>() decides which graphics item it is that receives mouse events. See the <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>() description for details.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>(), <a href="qgraphicsitem.html#mouseReleaseEvent">mouseReleaseEvent</a>(), <a href="qgraphicsitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a>(), and <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<!-- @@@mouseMoveEvent -->
<!-- $$$mousePressEvent[overload1]$$$mousePressEventQGraphicsSceneMouseEvent* -->
<h3 class="fn" id="mousePressEvent"><a name="mousePressEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">mousePressEvent</span>(<span class="type"><a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for event <i>event</i>, can be reimplemented to receive mouse press events for this item. Mouse press events are only delivered to items that accept the mouse button that is pressed. By default, an item accepts all mouse buttons, but you can change this by calling <a href="qgraphicsitem.html#setAcceptedMouseButtons">setAcceptedMouseButtons</a>().</p>
<p>The mouse press event decides which item should become the mouse grabber (see <a href="qgraphicsscene.html#mouseGrabberItem">QGraphicsScene::mouseGrabberItem</a>()). If you do not reimplement this function, the press event will propagate to any topmost item beneath this item, and no other mouse events will be delivered to this item.</p>
<p>If you do reimplement this function, <i>event</i> will by default be accepted (see <a href="../qtcore/qevent.html#accept">QEvent::accept</a>()), and this item is then the mouse grabber. This allows the item to receive future move, release and doubleclick events. If you call <a href="../qtcore/qevent.html#ignore">QEvent::ignore</a>() on <i>event</i>, this item will lose the mouse grab, and <i>event</i> will propagate to any topmost item beneath. No further mouse events will be delivered to this item unless a new mouse press event is received.</p>
<p>The default implementation handles basic item interaction, such as selection and moving. If you want to keep the base implementation when reimplementing this function, call QGraphicsItem::mousePressEvent() in your reimplementation.</p>
<p>The event is <a href="../qtcore/qevent.html#ignore">QEvent::ignore</a>()d for items that are neither <a href="qgraphicsitem.html#GraphicsItemFlag-enum">movable</a> nor <a href="qgraphicsitem.html#GraphicsItemFlag-enum">selectable</a>.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mouseMoveEvent">mouseMoveEvent</a>(), <a href="qgraphicsitem.html#mouseReleaseEvent">mouseReleaseEvent</a>(), <a href="qgraphicsitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a>(), and <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<!-- @@@mousePressEvent -->
<!-- $$$mouseReleaseEvent[overload1]$$$mouseReleaseEventQGraphicsSceneMouseEvent* -->
<h3 class="fn" id="mouseReleaseEvent"><a name="mouseReleaseEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">mouseReleaseEvent</span>(<span class="type"><a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for event <i>event</i>, can be reimplemented to receive mouse release events for this item.</p>
<p>Calling <a href="../qtcore/qevent.html#ignore">QEvent::ignore</a>() or <a href="../qtcore/qevent.html#accept">QEvent::accept</a>() on <i>event</i> has no effect.</p>
<p>The default implementation handles basic item interaction, such as selection and moving. If you want to keep the base implementation when reimplementing this function, call QGraphicsItem::mouseReleaseEvent() in your reimplementation.</p>
<p>Please note that <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>() decides which graphics item it is that receives mouse events. See the <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>() description for details.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>(), <a href="qgraphicsitem.html#mouseMoveEvent">mouseMoveEvent</a>(), <a href="qgraphicsitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a>(), and <a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<!-- @@@mouseReleaseEvent -->
<!-- $$$moveBy[overload1]$$$moveByqrealqreal -->
<h3 class="fn" id="moveBy"><a name="moveBy"></a><span class="type">void</span> QGraphicsItem::<span class="name">moveBy</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>dx</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>dy</i>)</h3>
<p>Moves the item by <i>dx</i> points horizontally, and <i>dy</i> point vertically. This function is equivalent to calling <a href="qgraphicsitem.html#setPos">setPos</a>(<a href="qgraphicsitem.html#pos">pos</a>() + <a href="../qtcore/qpointf.html">QPointF</a>(<i>dx</i>, <i>dy</i>)).</p>
<!-- @@@moveBy -->
<!-- $$$opacity[overload1]$$$opacity -->
<h3 class="fn" id="opacity"><a name="opacity"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QGraphicsItem::<span class="name">opacity</span>() const</h3>
<p>Returns this item's local opacity, which is between 0.0 (transparent) and 1.0 (opaque). This value is combined with parent and ancestor values into the <a href="qgraphicsitem.html#effectiveOpacity">effectiveOpacity</a>(). The effective opacity decides how the item is rendered and also affects its visibility when queried by functions such as <a href="qgraphicsview.html#items">QGraphicsView::items</a>().</p>
<p>The opacity property decides the state of the painter passed to the <a href="qgraphicsitem.html#paint">paint</a>() function. If the item is cached, i.e&#x2e;, <a href="qgraphicsitem.html#CacheMode-enum">ItemCoordinateCache</a> or <a href="qgraphicsitem.html#CacheMode-enum">DeviceCoordinateCache</a>, the effective property will be applied to the item's cache as it is rendered.</p>
<p>The default opacity is 1.0; fully opaque.</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setOpacity">setOpacity</a>(), <a href="qgraphicsitem.html#paint">paint</a>(), <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIgnoresParentOpacity</a>, and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemDoesntPropagateOpacityToChildren</a>.</p>
<!-- @@@opacity -->
<!-- $$$opaqueArea[overload1]$$$opaqueArea -->
<h3 class="fn" id="opaqueArea"><a name="opaqueArea"></a><code>[virtual] </code><span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> QGraphicsItem::<span class="name">opaqueArea</span>() const</h3>
<p>This virtual function returns a shape representing the area where this item is opaque. An area is opaque if it is filled using an opaque brush or color (i.e&#x2e;, not transparent).</p>
<p>This function is used by <a href="qgraphicsitem.html#isObscuredBy">isObscuredBy</a>(), which is called by underlying items to determine if they are obscured by this item.</p>
<p>The default implementation returns an empty <a href="../qtgui/qpainterpath.html">QPainterPath</a>, indicating that this item is completely transparent and does not obscure any other items.</p>
<p><b>See also </b><a href="qgraphicsitem.html#isObscuredBy">isObscuredBy</a>(), <a href="qgraphicsitem.html#isObscured">isObscured</a>(), and <a href="qgraphicsitem.html#shape">shape</a>().</p>
<!-- @@@opaqueArea -->
<!-- $$$paint[overload1]$$$paintQPainter*constQStyleOptionGraphicsItem*QWidget* -->
<h3 class="fn" id="paint"><a name="paint"></a><code>[pure virtual] </code><span class="type">void</span> QGraphicsItem::<span class="name">paint</span>(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> *<i>painter</i>, const <span class="type"><a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a></span> *<i>option</i>, <span class="type"><a href="qwidget.html">QWidget</a></span> *<i>widget</i> = Q_NULLPTR)</h3>
<p>This function, which is usually called by <a href="qgraphicsview.html">QGraphicsView</a>, paints the contents of an item in local coordinates.</p>
<p>Reimplement this function in a <a href="qgraphicsitem.html">QGraphicsItem</a> subclass to provide the item's painting implementation, using <i>painter</i>. The <i>option</i> parameter provides style options for the item, such as its state, exposed area and its level-of-detail hints. The <i>widget</i> argument is optional. If provided, it points to the widget that is being painted on; otherwise, it is 0. For cached painting, <i>widget</i> is always 0.</p>
<pre class="cpp">

  <span class="type">void</span> RoundRectItem<span class="operator">::</span>paint(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> <span class="operator">*</span>painter<span class="operator">,</span>
                            <span class="keyword">const</span> <span class="type"><a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a></span> <span class="operator">*</span>option<span class="operator">,</span>
                            <span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>widget)
  {
      painter<span class="operator">-</span><span class="operator">&gt;</span>drawRoundedRect(<span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="operator">-</span><span class="number">10</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">5</span><span class="operator">,</span> <span class="number">5</span>);
  }

</pre>
<p>The painter's pen is 0-width by default, and its pen is initialized to the <a href="../qtgui/qpalette.html#ColorRole-enum">QPalette::Text</a> brush from the paint device's palette. The brush is initialized to <a href="../qtgui/qpalette.html#ColorRole-enum">QPalette::Window</a>.</p>
<p>Make sure to constrain all painting inside the boundaries of <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() to avoid rendering artifacts (as <a href="qgraphicsview.html">QGraphicsView</a> does not clip the painter for you). In particular, when <a href="../qtgui/qpainter.html">QPainter</a> renders the outline of a shape using an assigned <a href="../qtgui/qpen.html">QPen</a>, half of the outline will be drawn outside, and half inside, the shape you're rendering (e.g&#x2e;, with a pen width of 2 units, you must draw outlines 1 unit inside <a href="qgraphicsitem.html#boundingRect">boundingRect</a>()). <a href="qgraphicsitem.html">QGraphicsItem</a> does not support use of cosmetic pens with a non-zero width.</p>
<p>All painting is done in local coordinates.</p>
<p><b>Note: </b>It is mandatory that an item will always redraw itself in the exact same way, unless <a href="qgraphicsitem.html#update">update</a>() was called; otherwise visual artifacts may occur. In other words, two subsequent calls to paint() must always produce the same output, unless <a href="qgraphicsitem.html#update">update</a>() was called between them.</p><p><b>Note: </b>Enabling caching for an item does not guarantee that paint() will be invoked only once by the Graphics View framework, even without any explicit call to <a href="qgraphicsitem.html#update">update</a>(). See the documentation of <a href="qgraphicsitem.html#setCacheMode">setCacheMode</a>() for more details.</p><p><b>See also </b><a href="qgraphicsitem.html#setCacheMode">setCacheMode</a>(), <a href="../qtgui/qpen.html#width">QPen::width</a>(), <a href="graphicsview.html#item-coordinates">Item Coordinates</a>, and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemUsesExtendedStyleOption</a>.</p>
<!-- @@@paint -->
<!-- $$$panel[overload1]$$$panel -->
<h3 class="fn" id="panel"><a name="panel"></a><span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *QGraphicsItem::<span class="name">panel</span>() const</h3>
<p>Returns the item's panel, or 0 if this item does not have a panel. If the item is a panel, it will return itself. Otherwise it will return the closest ancestor that is a panel.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#isPanel">isPanel</a>() and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsPanel</a>.</p>
<!-- @@@panel -->
<!-- $$$panelModality[overload1]$$$panelModality -->
<h3 class="fn" id="panelModality"><a name="panelModality"></a><span class="type"><a href="qgraphicsitem.html#PanelModality-enum">PanelModality</a></span> QGraphicsItem::<span class="name">panelModality</span>() const</h3>
<p>Returns the modality for this item.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setPanelModality">setPanelModality</a>().</p>
<!-- @@@panelModality -->
<!-- $$$parentItem[overload1]$$$parentItem -->
<h3 class="fn" id="parentItem"><a name="parentItem"></a><span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *QGraphicsItem::<span class="name">parentItem</span>() const</h3>
<p>Returns a pointer to this item's parent item. If this item does not have a parent, 0 is returned.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setParentItem">setParentItem</a>() and <a href="qgraphicsitem.html#childItems">childItems</a>().</p>
<!-- @@@parentItem -->
<!-- $$$parentObject[overload1]$$$parentObject -->
<h3 class="fn" id="parentObject"><a name="parentObject"></a><span class="type"><a href="qgraphicsobject.html">QGraphicsObject</a></span> *QGraphicsItem::<span class="name">parentObject</span>() const</h3>
<p>Returns a pointer to the item's parent, cast to a <a href="qgraphicsobject.html">QGraphicsObject</a>. returns 0 if the parent item is not a <a href="qgraphicsobject.html">QGraphicsObject</a>.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#parentItem">parentItem</a>() and <a href="qgraphicsitem.html#childItems">childItems</a>().</p>
<!-- @@@parentObject -->
<!-- $$$parentWidget[overload1]$$$parentWidget -->
<h3 class="fn" id="parentWidget"><a name="parentWidget"></a><span class="type"><a href="qgraphicswidget.html">QGraphicsWidget</a></span> *QGraphicsItem::<span class="name">parentWidget</span>() const</h3>
<p>Returns a pointer to the item's parent widget. The item's parent widget is the closest parent item that is a widget.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsitem.html#parentItem">parentItem</a>() and <a href="qgraphicsitem.html#childItems">childItems</a>().</p>
<!-- @@@parentWidget -->
<!-- $$$pos[overload1]$$$pos -->
<h3 class="fn" id="pos"><a name="pos"></a><span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> QGraphicsItem::<span class="name">pos</span>() const</h3>
<p>Returns the position of the item in parent coordinates. If the item has no parent, its position is given in scene coordinates.</p>
<p>The position of the item describes its origin (local coordinate (0, 0)) in parent coordinates; this function returns the same as <a href="qgraphicsitem.html#mapToParent">mapToParent</a>(0, 0).</p>
<p>For convenience, you can also call <a href="qgraphicsitem.html#scenePos">scenePos</a>() to determine the item's position in scene coordinates, regardless of its parent.</p>
<p><b>See also </b><a href="qgraphicsitem.html#x">x</a>(), <a href="qgraphicsitem.html#y">y</a>(), <a href="qgraphicsitem.html#setPos">setPos</a>(), <a href="qgraphicsitem.html#transform">transform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@pos -->
<!-- $$$prepareGeometryChange[overload1]$$$prepareGeometryChange -->
<h3 class="fn" id="prepareGeometryChange"><a name="prepareGeometryChange"></a><code>[protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">prepareGeometryChange</span>()</h3>
<p>Prepares the item for a geometry change. Call this function before changing the bounding rect of an item to keep <a href="qgraphicsscene.html">QGraphicsScene</a>'s index up to date.</p>
<p>prepareGeometryChange() will call <a href="qgraphicsitem.html#update">update</a>() if this is necessary.</p>
<p>Example:</p>
<pre class="cpp">

  <span class="type">void</span> CircleItem<span class="operator">::</span>setRadius(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> newRadius)
  {
      <span class="keyword">if</span> (radius <span class="operator">!</span><span class="operator">=</span> newRadius) {
          prepareGeometryChange();
          radius <span class="operator">=</span> newRadius;
      }
  }

</pre>
<p><b>See also </b><a href="qgraphicsitem.html#boundingRect">boundingRect</a>().</p>
<!-- @@@prepareGeometryChange -->
<!-- $$$removeSceneEventFilter[overload1]$$$removeSceneEventFilterQGraphicsItem* -->
<h3 class="fn" id="removeSceneEventFilter"><a name="removeSceneEventFilter"></a><span class="type">void</span> QGraphicsItem::<span class="name">removeSceneEventFilter</span>(<span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>filterItem</i>)</h3>
<p>Removes an event filter on this item from <i>filterItem</i>.</p>
<p><b>See also </b><a href="qgraphicsitem.html#installSceneEventFilter">installSceneEventFilter</a>().</p>
<!-- @@@removeSceneEventFilter -->
<!-- $$$resetTransform[overload1]$$$resetTransform -->
<h3 class="fn" id="resetTransform"><a name="resetTransform"></a><span class="type">void</span> QGraphicsItem::<span class="name">resetTransform</span>()</h3>
<p>Resets this item's transformation matrix to the identity matrix or all the transformation properties to their default values. This is equivalent to calling <code>setTransform(QTransform())</code>.</p>
<p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setTransform">setTransform</a>() and <a href="qgraphicsitem.html#transform">transform</a>().</p>
<!-- @@@resetTransform -->
<!-- $$$rotation[overload1]$$$rotation -->
<h3 class="fn" id="rotation"><a name="rotation"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QGraphicsItem::<span class="name">rotation</span>() const</h3>
<p>Returns the clockwise rotation, in degrees, around the Z axis. The default value is 0 (i.e&#x2e;, the item is not rotated).</p>
<p>The rotation is combined with the item's <a href="qgraphicsitem.html#scale">scale</a>(), <a href="qgraphicsitem.html#transform">transform</a>() and <a href="qgraphicsitem.html#transformations">transformations</a>() to map the item's coordinate system to the parent item.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setRotation">setRotation</a>(), <a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a>(), and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<!-- @@@rotation -->
<!-- $$$scale[overload1]$$$scale -->
<h3 class="fn" id="scale"><a name="scale"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QGraphicsItem::<span class="name">scale</span>() const</h3>
<p>Returns the scale factor of the item. The default scale factor is 1.0 (i.e&#x2e;, the item is not scaled).</p>
<p>The scale is combined with the item's <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#transform">transform</a>() and <a href="qgraphicsitem.html#transformations">transformations</a>() to map the item's coordinate system to the parent item.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setScale">setScale</a>(), <a href="qgraphicsitem.html#rotation">rotation</a>(), and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<!-- @@@scale -->
<!-- $$$scene[overload1]$$$scene -->
<h3 class="fn" id="scene"><a name="scene"></a><span class="type"><a href="qgraphicsscene.html">QGraphicsScene</a></span> *QGraphicsItem::<span class="name">scene</span>() const</h3>
<p>Returns the current scene for the item, or 0 if the item is not stored in a scene.</p>
<p>To add or move an item to a scene, call <a href="qgraphicsscene.html#addItem">QGraphicsScene::addItem</a>().</p>
<!-- @@@scene -->
<!-- $$$sceneBoundingRect[overload1]$$$sceneBoundingRect -->
<h3 class="fn" id="sceneBoundingRect"><a name="sceneBoundingRect"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsItem::<span class="name">sceneBoundingRect</span>() const</h3>
<p>Returns the bounding rect of this item in scene coordinates, by combining <a href="qgraphicsitem.html#sceneTransform">sceneTransform</a>() with <a href="qgraphicsitem.html#boundingRect">boundingRect</a>().</p>
<p><b>See also </b><a href="qgraphicsitem.html#boundingRect">boundingRect</a>() and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@sceneBoundingRect -->
<!-- $$$sceneEvent[overload1]$$$sceneEventQEvent* -->
<h3 class="fn" id="sceneEvent"><a name="sceneEvent"></a><code>[virtual protected] </code><span class="type">bool</span> QGraphicsItem::<span class="name">sceneEvent</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>event</i>)</h3>
<p>This virtual function receives events to this item. Reimplement this function to intercept events before they are dispatched to the specialized event handlers <a href="qgraphicsitem.html#contextMenuEvent">contextMenuEvent</a>(), <a href="qgraphicsitem.html#focusInEvent">focusInEvent</a>(), <a href="qgraphicsitem.html#focusOutEvent">focusOutEvent</a>(), <a href="qgraphicsitem.html#hoverEnterEvent">hoverEnterEvent</a>(), <a href="qgraphicsitem.html#hoverMoveEvent">hoverMoveEvent</a>(), <a href="qgraphicsitem.html#hoverLeaveEvent">hoverLeaveEvent</a>(), <a href="qgraphicsitem.html#keyPressEvent">keyPressEvent</a>(), <a href="qgraphicsitem.html#keyReleaseEvent">keyReleaseEvent</a>(), <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>(), <a href="qgraphicsitem.html#mouseReleaseEvent">mouseReleaseEvent</a>(), <a href="qgraphicsitem.html#mouseMoveEvent">mouseMoveEvent</a>(), and <a href="qgraphicsitem.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a>().</p>
<p>Returns <code>true</code> if the event was recognized and handled; otherwise, (e.g&#x2e;, if the event type was not recognized,) false is returned.</p>
<p><i>event</i> is the intercepted event.</p>
<!-- @@@sceneEvent -->
<!-- $$$sceneEventFilter[overload1]$$$sceneEventFilterQGraphicsItem*QEvent* -->
<h3 class="fn" id="sceneEventFilter"><a name="sceneEventFilter"></a><code>[virtual protected] </code><span class="type">bool</span> QGraphicsItem::<span class="name">sceneEventFilter</span>(<span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>watched</i>, <span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>event</i>)</h3>
<p>Filters events for the item <i>watched</i>. <i>event</i> is the filtered event.</p>
<p>Reimplementing this function in a subclass makes it possible for the item to be used as an event filter for other items, intercepting all the events sent to those items before they are able to respond.</p>
<p>Reimplementations must return true to prevent further processing of a given event, ensuring that it will not be delivered to the watched item, or return false to indicate that the event should be propagated further by the event system.</p>
<p><b>See also </b><a href="qgraphicsitem.html#installSceneEventFilter">installSceneEventFilter</a>().</p>
<!-- @@@sceneEventFilter -->
<!-- $$$scenePos[overload1]$$$scenePos -->
<h3 class="fn" id="scenePos"><a name="scenePos"></a><span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> QGraphicsItem::<span class="name">scenePos</span>() const</h3>
<p>Returns the item's position in scene coordinates. This is equivalent to calling <code>mapToScene(0, 0)</code>.</p>
<p><b>See also </b><a href="qgraphicsitem.html#pos">pos</a>(), <a href="qgraphicsitem.html#sceneTransform">sceneTransform</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@scenePos -->
<!-- $$$sceneTransform[overload1]$$$sceneTransform -->
<h3 class="fn" id="sceneTransform"><a name="sceneTransform"></a><span class="type"><a href="../qtgui/qtransform.html">QTransform</a></span> QGraphicsItem::<span class="name">sceneTransform</span>() const</h3>
<p>Returns this item's scene transformation matrix. This matrix can be used to map coordinates and geometrical shapes from this item's local coordinate system to the scene's coordinate system. To map coordinates from the scene, you must first invert the returned matrix.</p>
<p>Example:</p>
<pre class="cpp">

  <span class="type"><a href="qgraphicsrectitem.html">QGraphicsRectItem</a></span> rect;
  rect<span class="operator">.</span>setPos(<span class="number">100</span><span class="operator">,</span> <span class="number">100</span>);

  rect<span class="operator">.</span>sceneTransform()<span class="operator">.</span>map(<span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span>(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span>));
  <span class="comment">// returns QPointF(100, 100);</span>

  rect<span class="operator">.</span>sceneTransform()<span class="operator">.</span>inverted()<span class="operator">.</span>map(<span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span>(<span class="number">100</span><span class="operator">,</span> <span class="number">100</span>));
  <span class="comment">// returns QPointF(0, 0);</span>

</pre>
<p>Unlike <a href="qgraphicsitem.html#transform">transform</a>(), which returns only an item's local transformation, this function includes the item's (and any parents') position, and all the transfomation properties.</p>
<p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#setTransform">setTransform</a>(), <a href="qgraphicsitem.html#scenePos">scenePos</a>(), <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>, and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<!-- @@@sceneTransform -->
<!-- $$$scroll[overload1]$$$scrollqrealqrealconstQRectF& -->
<h3 class="fn" id="scroll"><a name="scroll"></a><span class="type">void</span> QGraphicsItem::<span class="name">scroll</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>dx</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>dy</i>, const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i> = QRectF())</h3>
<p>Scrolls the contents of <i>rect</i> by <i>dx</i>, <i>dy</i>. If <i>rect</i> is a null rect (the default), the item's bounding rect is scrolled.</p>
<p>Scrolling provides a fast alternative to simply redrawing when the contents of the item (or parts of the item) are shifted vertically or horizontally. Depending on the current transformation and the capabilities of the paint device (i.e&#x2e;, the viewport), this operation may consist of simply moving pixels from one location to another using memmove(). In most cases this is faster than rerendering the entire area.</p>
<p>After scrolling, the item will issue an update for the newly exposed areas. If scrolling is not supported (e.g&#x2e;, you are rendering to an OpenGL viewport, which does not benefit from scroll optimizations), this function is equivalent to calling update(<i>rect</i>).</p>
<p><b>Note:</b> Scrolling is only supported when <a href="qgraphicsitem.html#CacheMode-enum">QGraphicsItem::ItemCoordinateCache</a> is enabled; in all other cases calling this function is equivalent to calling update(<i>rect</i>). If you for sure know that the item is opaque and not overlapped by other items, you can map the <i>rect</i> to viewport coordinates and scroll the viewport.</p>
<pre class="cpp">

  <span class="type"><a href="../qtgui/qtransform.html">QTransform</a></span> xform <span class="operator">=</span> item<span class="operator">-</span><span class="operator">&gt;</span>deviceTransform(view<span class="operator">-</span><span class="operator">&gt;</span>viewportTransform());
  <span class="type"><a href="../qtcore/qrect.html">QRect</a></span> deviceRect <span class="operator">=</span> xform<span class="operator">.</span>mapRect(rect)<span class="operator">.</span>toAlignedRect();
  view<span class="operator">-</span><span class="operator">&gt;</span>viewport()<span class="operator">-</span><span class="operator">&gt;</span>scroll(dx<span class="operator">,</span> dy<span class="operator">,</span> deviceRect);

</pre>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsitem.html#boundingRect">boundingRect</a>().</p>
<!-- @@@scroll -->
<!-- $$$setAcceptDrops[overload1]$$$setAcceptDropsbool -->
<h3 class="fn" id="setAcceptDrops"><a name="setAcceptDrops"></a><span class="type">void</span> QGraphicsItem::<span class="name">setAcceptDrops</span>(<span class="type">bool</span> <i>on</i>)</h3>
<p>If <i>on</i> is true, this item will accept drag and drop events; otherwise, it is transparent for drag and drop events. By default, items do not accept drag and drop events.</p>
<p><b>See also </b><a href="qgraphicsitem.html#acceptDrops">acceptDrops</a>().</p>
<!-- @@@setAcceptDrops -->
<!-- $$$setAcceptHoverEvents[overload1]$$$setAcceptHoverEventsbool -->
<h3 class="fn" id="setAcceptHoverEvents"><a name="setAcceptHoverEvents"></a><span class="type">void</span> QGraphicsItem::<span class="name">setAcceptHoverEvents</span>(<span class="type">bool</span> <i>enabled</i>)</h3>
<p>If <i>enabled</i> is true, this item will accept hover events; otherwise, it will ignore them. By default, items do not accept hover events.</p>
<p>Hover events are delivered when there is no current mouse grabber item. They are sent when the mouse cursor enters an item, when it moves around inside the item, and when the cursor leaves an item. Hover events are commonly used to highlight an item when it's entered, and for tracking the mouse cursor as it hovers over the item (equivalent to <a href="qwidget.html#mouseTracking-prop">QWidget::mouseTracking</a>).</p>
<p>Parent items receive hover enter events before their children, and leave events after their children. The parent does not receive a hover leave event if the cursor enters a child, though; the parent stays &quot;hovered&quot; until the cursor leaves its area, including its children's areas.</p>
<p>If a parent item handles child events, it will receive hover move, drag move, and drop events as the cursor passes through its children, but it does not receive hover enter and hover leave, nor drag enter and drag leave events on behalf of its children.</p>
<p>A <a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> with window decorations will accept hover events regardless of the value of <a href="qgraphicsitem.html#acceptHoverEvents">acceptHoverEvents</a>().</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsitem.html#acceptHoverEvents">acceptHoverEvents</a>(), <a href="qgraphicsitem.html#hoverEnterEvent">hoverEnterEvent</a>(), <a href="qgraphicsitem.html#hoverMoveEvent">hoverMoveEvent</a>(), and <a href="qgraphicsitem.html#hoverLeaveEvent">hoverLeaveEvent</a>().</p>
<!-- @@@setAcceptHoverEvents -->
<!-- $$$setAcceptTouchEvents[overload1]$$$setAcceptTouchEventsbool -->
<h3 class="fn" id="setAcceptTouchEvents"><a name="setAcceptTouchEvents"></a><span class="type">void</span> QGraphicsItem::<span class="name">setAcceptTouchEvents</span>(<span class="type">bool</span> <i>enabled</i>)</h3>
<p>If <i>enabled</i> is true, this item will accept <a href="../qtgui/qtouchevent.html">touch events</a>; otherwise, it will ignore them. By default, items do not accept touch events.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#acceptTouchEvents">acceptTouchEvents</a>().</p>
<!-- @@@setAcceptTouchEvents -->
<!-- $$$setAcceptedMouseButtons[overload1]$$$setAcceptedMouseButtonsQt::MouseButtons -->
<h3 class="fn" id="setAcceptedMouseButtons"><a name="setAcceptedMouseButtons"></a><span class="type">void</span> QGraphicsItem::<span class="name">setAcceptedMouseButtons</span>(<span class="type"><a href="../qtcore/qt.html#MouseButton-enum">Qt::MouseButtons</a></span> <i>buttons</i>)</h3>
<p>Sets the mouse <i>buttons</i> that this item accepts mouse events for.</p>
<p>By default, all mouse buttons are accepted. If an item accepts a mouse button, it will become the mouse grabber item when a mouse press event is delivered for that button. However, if the item does not accept the mouse button, <a href="qgraphicsscene.html">QGraphicsScene</a> will forward the mouse events to the first item beneath it that does.</p>
<p>To disable mouse events for an item (i.e&#x2e;, make it transparent for mouse events), call setAcceptedMouseButtons(0).</p>
<p><b>See also </b><a href="qgraphicsitem.html#acceptedMouseButtons">acceptedMouseButtons</a>() and <a href="qgraphicsitem.html#mousePressEvent">mousePressEvent</a>().</p>
<!-- @@@setAcceptedMouseButtons -->
<!-- $$$setActive[overload1]$$$setActivebool -->
<h3 class="fn" id="setActive"><a name="setActive"></a><span class="type">void</span> QGraphicsItem::<span class="name">setActive</span>(<span class="type">bool</span> <i>active</i>)</h3>
<p>If <i>active</i> is true, and the scene is active, this item's panel will be activated. Otherwise, the panel is deactivated.</p>
<p>If the item is not part of an active scene, <i>active</i> will decide what happens to the panel when the scene becomes active or the item is added to the scene. If true, the item's panel will be activated when the item is either added to the scene or the scene is activated. Otherwise, the item will stay inactive independent of the scene's activated state.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#isPanel">isPanel</a>(), <a href="qgraphicsscene.html#setActivePanel">QGraphicsScene::setActivePanel</a>(), and <a href="qgraphicsscene.html#isActive">QGraphicsScene::isActive</a>().</p>
<!-- @@@setActive -->
<!-- $$$setBoundingRegionGranularity[overload1]$$$setBoundingRegionGranularityqreal -->
<h3 class="fn" id="setBoundingRegionGranularity"><a name="setBoundingRegionGranularity"></a><span class="type">void</span> QGraphicsItem::<span class="name">setBoundingRegionGranularity</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>granularity</i>)</h3>
<p>Sets the bounding region granularity to <i>granularity</i>; a value between and including 0 and 1. The default value is 0 (i.e&#x2e;, the lowest granularity, where the bounding region corresponds to the item's bounding rectangle).</p>
<p>The granularity is used by <a href="qgraphicsitem.html#boundingRegion">boundingRegion</a>() to calculate how fine the bounding region of the item should be. The highest achievable granularity is 1, where <a href="qgraphicsitem.html#boundingRegion">boundingRegion</a>() will return the finest outline possible for the respective device (e.g&#x2e;, for a <a href="qgraphicsview.html">QGraphicsView</a> viewport, this gives you a pixel-perfect bounding region). The lowest possible granularity is 0. The value of <i>granularity</i> describes the ratio between device resolution and the resolution of the bounding region (e.g&#x2e;, a value of 0.25 will provide a region where each chunk corresponds to 4x4 device units / pixels).</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsitem.html#boundingRegionGranularity">boundingRegionGranularity</a>().</p>
<!-- @@@setBoundingRegionGranularity -->
<!-- $$$setCacheMode[overload1]$$$setCacheModeCacheModeconstQSize& -->
<h3 class="fn" id="setCacheMode"><a name="setCacheMode"></a><span class="type">void</span> QGraphicsItem::<span class="name">setCacheMode</span>(<span class="type"><a href="qgraphicsitem.html#CacheMode-enum">CacheMode</a></span> <i>mode</i>, const <span class="type"><a href="../qtcore/qsize.html">QSize</a></span> &amp;<i>logicalCacheSize</i> = QSize())</h3>
<p>Sets the item's cache mode to <i>mode</i>.</p>
<p>The optional <i>logicalCacheSize</i> argument is used only by <a href="qgraphicsitem.html#CacheMode-enum">ItemCoordinateCache</a> mode, and describes the resolution of the cache buffer; if <i>logicalCacheSize</i> is (100, 100), <a href="qgraphicsitem.html">QGraphicsItem</a> will fit the item into 100x100 pixels in graphics memory, regardless of the logical size of the item itself. By default <a href="qgraphicsitem.html">QGraphicsItem</a> uses the size of <a href="qgraphicsitem.html#boundingRect">boundingRect</a>(). For all other cache modes than <a href="qgraphicsitem.html#CacheMode-enum">ItemCoordinateCache</a>, <i>logicalCacheSize</i> is ignored.</p>
<p>Caching can speed up rendering if your item spends a significant time redrawing itself. In some cases the cache can also slow down rendering, in particular when the item spends less time redrawing than <a href="qgraphicsitem.html">QGraphicsItem</a> spends redrawing from the cache.</p>
<p>When caching is enabled, an item's <a href="qgraphicsitem.html#paint">paint</a>() function will generally draw into an offscreen pixmap cache; for any subsequent repaint requests, the Graphics View framework will redraw from the cache. This approach works particularly well with QGLWidget, which stores all the cache as OpenGL textures.</p>
<p>Be aware that <a href="../qtgui/qpixmapcache.html">QPixmapCache</a>'s cache limit may need to be changed to obtain optimal performance.</p>
<p>You can read more about the different cache modes in the <a href="qgraphicsitem.html#CacheMode-enum">CacheMode</a> documentation.</p>
<p><b>Note: </b>Enabling caching does not imply that the item's <a href="qgraphicsitem.html#paint">paint</a>() function will be called only in response to an explicit <a href="qgraphicsitem.html#update">update</a>() call. For instance, under memory pressure, Qt may decide to drop some of the cache information; in such cases an item's <a href="qgraphicsitem.html#paint">paint</a>() function will be called even if there was no <a href="qgraphicsitem.html#update">update</a>() call (that is, exactly as if there were no caching enabled).</p><p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsitem.html#cacheMode">cacheMode</a>(), <a href="qgraphicsitem.html#CacheMode-enum">CacheMode</a>, and <a href="../qtgui/qpixmapcache.html#setCacheLimit">QPixmapCache::setCacheLimit</a>().</p>
<!-- @@@setCacheMode -->
<!-- $$$setCursor[overload1]$$$setCursorconstQCursor& -->
<h3 class="fn" id="setCursor"><a name="setCursor"></a><span class="type">void</span> QGraphicsItem::<span class="name">setCursor</span>(const <span class="type"><a href="../qtgui/qcursor.html">QCursor</a></span> &amp;<i>cursor</i>)</h3>
<p>Sets the current cursor shape for the item to <i>cursor</i>. The mouse cursor will assume this shape when it's over this item. See the <a href="../qtcore/qt.html#CursorShape-enum">list of predefined cursor objects</a> for a range of useful shapes.</p>
<p>An editor item might want to use an I-beam cursor:</p>
<pre class="cpp">

  item<span class="operator">-</span><span class="operator">&gt;</span>setCursor(<span class="type"><a href="../qtcore/qt.html">Qt</a></span><span class="operator">::</span>IBeamCursor);

</pre>
<p>If no cursor has been set, the cursor of the item beneath is used.</p>
<p><b>See also </b><a href="qgraphicsitem.html#cursor">cursor</a>(), <a href="qgraphicsitem.html#hasCursor">hasCursor</a>(), <a href="qgraphicsitem.html#unsetCursor">unsetCursor</a>(), <a href="qwidget.html#cursor-prop">QWidget::cursor</a>, and <a href="../qtgui/qguiapplication.html#overrideCursor">QApplication::overrideCursor</a>().</p>
<!-- @@@setCursor -->
<!-- $$$setData[overload1]$$$setDataintconstQVariant& -->
<h3 class="fn" id="setData"><a name="setData"></a><span class="type">void</span> QGraphicsItem::<span class="name">setData</span>(<span class="type">int</span> <i>key</i>, const <span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> &amp;<i>value</i>)</h3>
<p>Sets this item's custom data for the key <i>key</i> to <i>value</i>.</p>
<p>Custom item data is useful for storing arbitrary properties for any item. Qt does not use this feature for storing data; it is provided solely for the convenience of the user.</p>
<p><b>See also </b><a href="qgraphicsitem.html#data">data</a>().</p>
<!-- @@@setData -->
<!-- $$$setEnabled[overload1]$$$setEnabledbool -->
<h3 class="fn" id="setEnabled"><a name="setEnabled"></a><span class="type">void</span> QGraphicsItem::<span class="name">setEnabled</span>(<span class="type">bool</span> <i>enabled</i>)</h3>
<p>If <i>enabled</i> is true, the item is enabled; otherwise, it is disabled.</p>
<p>Disabled items are visible, but they do not receive any events, and cannot take focus nor be selected. Mouse events are discarded; they are not propagated unless the item is also invisible, or if it does not accept mouse events (see <a href="qgraphicsitem.html#acceptedMouseButtons">acceptedMouseButtons</a>()). A disabled item cannot become the mouse grabber, and as a result of this, an item loses the grab if it becomes disabled when grabbing the mouse, just like it loses focus if it had focus when it was disabled.</p>
<p>Disabled items are traditionally drawn using grayed-out colors (see <a href="../qtgui/qpalette.html#ColorGroup-enum">QPalette::Disabled</a>).</p>
<p>If you disable a parent item, all its children will also be disabled. If you enable a parent item, all children will be enabled, unless they have been explicitly disabled (i.e&#x2e;, if you call setEnabled(false) on a child, it will not be reenabled if its parent is disabled, and then enabled again).</p>
<p>Items are enabled by default.</p>
<p><b>Note: </b>If you install an event filter, you can still intercept events before they are delivered to items; this mechanism disregards the item's enabled state.</p><p><b>See also </b><a href="qgraphicsitem.html#isEnabled">isEnabled</a>().</p>
<!-- @@@setEnabled -->
<!-- $$$setFiltersChildEvents[overload1]$$$setFiltersChildEventsbool -->
<h3 class="fn" id="setFiltersChildEvents"><a name="setFiltersChildEvents"></a><span class="type">void</span> QGraphicsItem::<span class="name">setFiltersChildEvents</span>(<span class="type">bool</span> <i>enabled</i>)</h3>
<p>If <i>enabled</i> is true, this item is set to filter all events for all its children (i.e&#x2e;, all events intented for any of its children are instead sent to this item); otherwise, if <i>enabled</i> is false, this item will only handle its own events. The default value is false.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#filtersChildEvents">filtersChildEvents</a>().</p>
<!-- @@@setFiltersChildEvents -->
<!-- $$$setFlag[overload1]$$$setFlagGraphicsItemFlagbool -->
<h3 class="fn" id="setFlag"><a name="setFlag"></a><span class="type">void</span> QGraphicsItem::<span class="name">setFlag</span>(<span class="type"><a href="qgraphicsitem.html#GraphicsItemFlag-enum">GraphicsItemFlag</a></span> <i>flag</i>, <span class="type">bool</span> <i>enabled</i> = true)</h3>
<p>If <i>enabled</i> is true, the item flag <i>flag</i> is enabled; otherwise, it is disabled.</p>
<p><b>See also </b><a href="qgraphicsitem.html#flags">flags</a>() and <a href="qgraphicsitem.html#setFlags">setFlags</a>().</p>
<!-- @@@setFlag -->
<!-- $$$setFlags[overload1]$$$setFlagsGraphicsItemFlags -->
<h3 class="fn" id="setFlags"><a name="setFlags"></a><span class="type">void</span> QGraphicsItem::<span class="name">setFlags</span>(<span class="type"><a href="qgraphicsitem.html#GraphicsItemFlag-enum">GraphicsItemFlags</a></span> <i>flags</i>)</h3>
<p>Sets the item flags to <i>flags</i>. All flags in <i>flags</i> are enabled; all flags not in <i>flags</i> are disabled.</p>
<p>If the item had focus and <i>flags</i> does not enable <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a>, the item loses focus as a result of calling this function. Similarly, if the item was selected, and <i>flags</i> does not enabled <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsSelectable</a>, the item is automatically unselected.</p>
<p>By default, no flags are enabled. (<a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> enables the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a> flag by default in order to track position changes.)</p>
<p><b>See also </b><a href="qgraphicsitem.html#flags">flags</a>() and <a href="qgraphicsitem.html#setFlag">setFlag</a>().</p>
<!-- @@@setFlags -->
<!-- $$$setFocus[overload1]$$$setFocusQt::FocusReason -->
<h3 class="fn" id="setFocus"><a name="setFocus"></a><span class="type">void</span> QGraphicsItem::<span class="name">setFocus</span>(<span class="type"><a href="../qtcore/qt.html#FocusReason-enum">Qt::FocusReason</a></span> <i>focusReason</i> = Qt::OtherFocusReason)</h3>
<p>Gives keyboard input focus to this item. The <i>focusReason</i> argument will be passed into any <a href="../qtgui/qfocusevent.html">focus event</a> generated by this function; it is used to give an explanation of what caused the item to get focus.</p>
<p>Only enabled items that set the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a> flag can accept keyboard focus.</p>
<p>If this item is not visible, not active, or not associated with a scene, it will not gain immediate input focus. However, it will be registered as the preferred focus item for its subtree of items, should it later become visible.</p>
<p>As a result of calling this function, this item will receive a <a href="qgraphicsitem.html#focusInEvent">focus in event</a> with <i>focusReason</i>. If another item already has focus, that item will first receive a <a href="qgraphicsitem.html#focusOutEvent">focus out event</a> indicating that it has lost input focus.</p>
<p><b>See also </b><a href="qgraphicsitem.html#clearFocus">clearFocus</a>(), <a href="qgraphicsitem.html#hasFocus">hasFocus</a>(), <a href="qgraphicsitem.html#focusItem">focusItem</a>(), and <a href="qgraphicsitem.html#focusProxy">focusProxy</a>().</p>
<!-- @@@setFocus -->
<!-- $$$setFocusProxy[overload1]$$$setFocusProxyQGraphicsItem* -->
<h3 class="fn" id="setFocusProxy"><a name="setFocusProxy"></a><span class="type">void</span> QGraphicsItem::<span class="name">setFocusProxy</span>(<span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>)</h3>
<p>Sets the item's focus proxy to <i>item</i>.</p>
<p>If an item has a focus proxy, the focus proxy will receive input focus when the item gains input focus. The item itself will still have focus (i.e&#x2e;, <a href="qgraphicsitem.html#hasFocus">hasFocus</a>() will return true), but only the focus proxy will receive the keyboard input.</p>
<p>A focus proxy can itself have a focus proxy, and so on. In such case, keyboard input will be handled by the outermost focus proxy.</p>
<p>The focus proxy <i>item</i> must belong to the same scene as this item.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#focusProxy">focusProxy</a>(), <a href="qgraphicsitem.html#setFocus">setFocus</a>(), and <a href="qgraphicsitem.html#hasFocus">hasFocus</a>().</p>
<!-- @@@setFocusProxy -->
<!-- $$$setGraphicsEffect[overload1]$$$setGraphicsEffectQGraphicsEffect* -->
<h3 class="fn" id="setGraphicsEffect"><a name="setGraphicsEffect"></a><span class="type">void</span> QGraphicsItem::<span class="name">setGraphicsEffect</span>(<span class="type"><a href="qgraphicseffect.html">QGraphicsEffect</a></span> *<i>effect</i>)</h3>
<p>Sets <i>effect</i> as the item's effect. If there already is an effect installed on this item, <a href="qgraphicsitem.html">QGraphicsItem</a> will delete the existing effect before installing the new <i>effect</i>. You can delete an existing effect by calling setGraphicsEffect(0).</p>
<p>If <i>effect</i> is the installed effect on a different item, setGraphicsEffect() will remove the effect from the item and install it on this item.</p>
<p><a href="qgraphicsitem.html">QGraphicsItem</a> takes ownership of <i>effect</i>.</p>
<p><b>Note: </b>This function will apply the effect on itself and all its children.</p><p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#graphicsEffect">graphicsEffect</a>().</p>
<!-- @@@setGraphicsEffect -->
<!-- $$$setGroup[overload1]$$$setGroupQGraphicsItemGroup* -->
<h3 class="fn" id="setGroup"><a name="setGroup"></a><span class="type">void</span> QGraphicsItem::<span class="name">setGroup</span>(<span class="type"><a href="qgraphicsitemgroup.html">QGraphicsItemGroup</a></span> *<i>group</i>)</h3>
<p>Adds this item to the item group <i>group</i>. If <i>group</i> is 0, this item is removed from any current group and added as a child of the previous group's parent.</p>
<p><b>See also </b><a href="qgraphicsitem.html#group">group</a>() and <a href="qgraphicsscene.html#createItemGroup">QGraphicsScene::createItemGroup</a>().</p>
<!-- @@@setGroup -->
<!-- $$$setInputMethodHints[overload1]$$$setInputMethodHintsQt::InputMethodHints -->
<h3 class="fn" id="setInputMethodHints"><a name="setInputMethodHints"></a><span class="type">void</span> QGraphicsItem::<span class="name">setInputMethodHints</span>(<span class="type"><a href="../qtcore/qt.html#InputMethodHint-enum">Qt::InputMethodHints</a></span> <i>hints</i>)</h3>
<p>Sets the current input method hints of this item to <i>hints</i>.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#inputMethodHints">inputMethodHints</a>() and <a href="qgraphicsitem.html#inputMethodQuery">inputMethodQuery</a>().</p>
<!-- @@@setInputMethodHints -->
<!-- $$$setOpacity[overload1]$$$setOpacityqreal -->
<h3 class="fn" id="setOpacity"><a name="setOpacity"></a><span class="type">void</span> QGraphicsItem::<span class="name">setOpacity</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>opacity</i>)</h3>
<p>Sets this item's local <i>opacity</i>, between 0.0 (transparent) and 1.0 (opaque). The item's local opacity is combined with parent and ancestor opacities into the <a href="qgraphicsitem.html#effectiveOpacity">effectiveOpacity</a>().</p>
<p>By default, opacity propagates from parent to child, so if a parent's opacity is 0.5 and the child is also 0.5, the child's effective opacity will be 0.25.</p>
<p>The opacity property decides the state of the painter passed to the <a href="qgraphicsitem.html#paint">paint</a>() function. If the item is cached, i.e&#x2e;, <a href="qgraphicsitem.html#CacheMode-enum">ItemCoordinateCache</a> or <a href="qgraphicsitem.html#CacheMode-enum">DeviceCoordinateCache</a>, the effective property will be applied to the item's cache as it is rendered.</p>
<p>There are two item flags that affect how the item's opacity is combined with the parent: <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIgnoresParentOpacity</a> and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemDoesntPropagateOpacityToChildren</a>.</p>
<p><b>Note: </b>Setting the opacity of an item to 0 will not make the item invisible (according to <a href="qgraphicsitem.html#isVisible">isVisible</a>()), but the item will be treated like an invisible one. See the documentation of <a href="qgraphicsitem.html#setVisible">setVisible</a>() for more information.</p><p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qgraphicsitem.html#opacity">opacity</a>(), <a href="qgraphicsitem.html#effectiveOpacity">effectiveOpacity</a>(), and <a href="qgraphicsitem.html#setVisible">setVisible</a>().</p>
<!-- @@@setOpacity -->
<!-- $$$setPanelModality[overload1]$$$setPanelModalityPanelModality -->
<h3 class="fn" id="setPanelModality"><a name="setPanelModality"></a><span class="type">void</span> QGraphicsItem::<span class="name">setPanelModality</span>(<span class="type"><a href="qgraphicsitem.html#PanelModality-enum">PanelModality</a></span> <i>panelModality</i>)</h3>
<p>Sets the modality for this item to <i>panelModality</i>.</p>
<p>Changing the modality of a visible item takes effect immediately.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#panelModality">panelModality</a>().</p>
<!-- @@@setPanelModality -->
<!-- $$$setParentItem[overload1]$$$setParentItemQGraphicsItem* -->
<h3 class="fn" id="setParentItem"><a name="setParentItem"></a><span class="type">void</span> QGraphicsItem::<span class="name">setParentItem</span>(<span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>newParent</i>)</h3>
<p>Sets this item's parent item to <i>newParent</i>. If this item already has a parent, it is first removed from the previous parent. If <i>newParent</i> is 0, this item will become a top-level item.</p>
<p>Note that this implicitly adds this graphics item to the scene of the parent. You should not <a href="qgraphicsscene.html#addItem">add</a> the item to the scene yourself.</p>
<p>The behavior when calling this function on an item that is an ancestor of <i>newParent</i> is undefined.</p>
<p><b>See also </b><a href="qgraphicsitem.html#parentItem">parentItem</a>() and <a href="qgraphicsitem.html#childItems">childItems</a>().</p>
<!-- @@@setParentItem -->
<!-- $$$setPos[overload1]$$$setPosconstQPointF& -->
<h3 class="fn" id="setPos"><a name="setPos"></a><span class="type">void</span> QGraphicsItem::<span class="name">setPos</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>pos</i>)</h3>
<p>Sets the position of the item to <i>pos</i>, which is in parent coordinates. For items with no parent, <i>pos</i> is in scene coordinates.</p>
<p>The position of the item describes its origin (local coordinate (0, 0)) in parent coordinates.</p>
<p><b>See also </b><a href="qgraphicsitem.html#pos">pos</a>(), <a href="qgraphicsitem.html#scenePos">scenePos</a>(), and <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>.</p>
<!-- @@@setPos -->
<!-- $$$setPos$$$setPosqrealqreal -->
<h3 class="fn" id="setPos-1"><a name="setPos-1"></a><span class="type">void</span> QGraphicsItem::<span class="name">setPos</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>)</h3>
<p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#setPos">setPos</a>(<a href="../qtcore/qpointf.html">QPointF</a>(<i>x</i>, <i>y</i>)).</p>
<!-- @@@setPos -->
<!-- $$$setRotation[overload1]$$$setRotationqreal -->
<h3 class="fn" id="setRotation"><a name="setRotation"></a><span class="type">void</span> QGraphicsItem::<span class="name">setRotation</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>angle</i>)</h3>
<p>Sets the clockwise rotation <i>angle</i>, in degrees, around the Z axis. The default value is 0 (i.e&#x2e;, the item is not rotated). Assigning a negative value will rotate the item counter-clockwise. Normally the rotation angle is in the range (-360, 360), but it's also possible to assign values outside of this range (e.g&#x2e;, a rotation of 370 degrees is the same as a rotation of 10 degrees).</p>
<p>The item is rotated around its transform origin point, which by default is (0, 0). You can select a different transformation origin by calling <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>().</p>
<p>The rotation is combined with the item's <a href="qgraphicsitem.html#scale">scale</a>(), <a href="qgraphicsitem.html#transform">transform</a>() and <a href="qgraphicsitem.html#transformations">transformations</a>() to map the item's coordinate system to the parent item.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>(), and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<!-- @@@setRotation -->
<!-- $$$setScale[overload1]$$$setScaleqreal -->
<h3 class="fn" id="setScale"><a name="setScale"></a><span class="type">void</span> QGraphicsItem::<span class="name">setScale</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>factor</i>)</h3>
<p>Sets the scale <i>factor</i> of the item. The default scale factor is 1.0 (i.e&#x2e;, the item is not scaled). A scale factor of 0.0 will collapse the item to a single point. If you provide a negative scale factor, the item will be flipped and mirrored (i.e&#x2e;, rotated 180 degrees).</p>
<p>The item is scaled around its transform origin point, which by default is (0, 0). You can select a different transformation origin by calling <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>().</p>
<p>The scale is combined with the item's <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#transform">transform</a>() and <a href="qgraphicsitem.html#transformations">transformations</a>() to map the item's coordinate system to the parent item.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#scale">scale</a>(), <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>(), and <a href="qtwidgets-painting-transformations-example.html">Transformations Example</a>.</p>
<!-- @@@setScale -->
<!-- $$$setSelected[overload1]$$$setSelectedbool -->
<h3 class="fn" id="setSelected"><a name="setSelected"></a><span class="type">void</span> QGraphicsItem::<span class="name">setSelected</span>(<span class="type">bool</span> <i>selected</i>)</h3>
<p>If <i>selected</i> is true and this item is selectable, this item is selected; otherwise, it is unselected.</p>
<p>If the item is in a group, the whole group's selected state is toggled by this function. If the group is selected, all items in the group are also selected, and if the group is not selected, no item in the group is selected.</p>
<p>Only visible, enabled, selectable items can be selected. If <i>selected</i> is true and this item is either invisible or disabled or unselectable, this function does nothing.</p>
<p>By default, items cannot be selected. To enable selection, set the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsSelectable</a> flag.</p>
<p>This function is provided for convenience, allowing individual toggling of the selected state of an item. However, a more common way of selecting items is to call <a href="qgraphicsscene.html#setSelectionArea">QGraphicsScene::setSelectionArea</a>(), which will call this function for all visible, enabled, and selectable items within a specified area on the scene.</p>
<p><b>See also </b><a href="qgraphicsitem.html#isSelected">isSelected</a>() and <a href="qgraphicsscene.html#selectedItems">QGraphicsScene::selectedItems</a>().</p>
<!-- @@@setSelected -->
<!-- $$$setToolTip[overload1]$$$setToolTipconstQString& -->
<h3 class="fn" id="setToolTip"><a name="setToolTip"></a><span class="type">void</span> QGraphicsItem::<span class="name">setToolTip</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>toolTip</i>)</h3>
<p>Sets the item's tool tip to <i>toolTip</i>. If <i>toolTip</i> is empty, the item's tool tip is cleared.</p>
<p><b>See also </b><a href="qgraphicsitem.html#toolTip">toolTip</a>() and <a href="qtooltip.html">QToolTip</a>.</p>
<!-- @@@setToolTip -->
<!-- $$$setTransform[overload1]$$$setTransformconstQTransform&bool -->
<h3 class="fn" id="setTransform"><a name="setTransform"></a><span class="type">void</span> QGraphicsItem::<span class="name">setTransform</span>(const <span class="type"><a href="../qtgui/qtransform.html">QTransform</a></span> &amp;<i>matrix</i>, <span class="type">bool</span> <i>combine</i> = false)</h3>
<p>Sets the item's current transformation matrix to <i>matrix</i>.</p>
<p>If <i>combine</i> is true, then <i>matrix</i> is combined with the current matrix; otherwise, <i>matrix</i> <i>replaces</i> the current matrix. <i>combine</i> is false by default.</p>
<p>To simplify interaction with items using a transformed view, <a href="qgraphicsitem.html">QGraphicsItem</a> provides mapTo... and mapFrom... functions that can translate between items' and the scene's coordinates. For example, you can call <a href="qgraphicsitem.html#mapToScene">mapToScene</a>() to map an item coordiate to a scene coordinate, or <a href="qgraphicsitem.html#mapFromScene">mapFromScene</a>() to map from scene coordinates to item coordinates.</p>
<p>The transformation matrix is combined with the item's <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#scale">scale</a>() and <a href="qgraphicsitem.html#transformations">transformations</a>() into a combined transformation that maps the item's coordinate system to its parent.</p>
<p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="qgraphicsitem.html#transform">transform</a>(), <a href="qgraphicsitem.html#setRotation">setRotation</a>(), <a href="qgraphicsitem.html#setScale">setScale</a>(), <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>(), <a href="graphicsview.html#the-graphics-view-coordinate-system">The Graphics View Coordinate System</a>, and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<!-- @@@setTransform -->
<!-- $$$setTransformOriginPoint[overload1]$$$setTransformOriginPointconstQPointF& -->
<h3 class="fn" id="setTransformOriginPoint"><a name="setTransformOriginPoint"></a><span class="type">void</span> QGraphicsItem::<span class="name">setTransformOriginPoint</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>origin</i>)</h3>
<p>Sets the <i>origin</i> point for the transformation in item coordinates.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a>() and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<!-- @@@setTransformOriginPoint -->
<!-- $$$setTransformOriginPoint$$$setTransformOriginPointqrealqreal -->
<h3 class="fn" id="setTransformOriginPoint-1"><a name="setTransformOriginPoint-1"></a><span class="type">void</span> QGraphicsItem::<span class="name">setTransformOriginPoint</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>)</h3>
<p>This is an overloaded function.</p>
<p>Sets the origin point for the transformation in item coordinates. This is equivalent to calling <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>(<a href="../qtcore/qpointf.html">QPointF</a>(<i>x</i>, <i>y</i>)).</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>() and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<!-- @@@setTransformOriginPoint -->
<!-- $$$setTransformations[overload1]$$$setTransformationsconstQList<QGraphicsTransform*>& -->
<h3 class="fn" id="setTransformations"><a name="setTransformations"></a><span class="type">void</span> QGraphicsItem::<span class="name">setTransformations</span>(const <span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qgraphicstransform.html">QGraphicsTransform</a></span> *&gt; &amp;<i>transformations</i>)</h3>
<p>Sets a list of graphics <i>transformations</i> (<a href="qgraphicstransform.html">QGraphicsTransform</a>) that currently apply to this item.</p>
<p>If all you want is to rotate or scale an item, you should call <a href="qgraphicsitem.html#setRotation">setRotation</a>() or <a href="qgraphicsitem.html#setScale">setScale</a>() instead. If you want to set an arbitrary transformation on an item, you can call <a href="qgraphicsitem.html#setTransform">setTransform</a>().</p>
<p><a href="qgraphicstransform.html">QGraphicsTransform</a> is for applying and controlling a chain of individual transformation operations on an item. It's particularly useful in animations, where each transform operation needs to be interpolated independently, or differently.</p>
<p>The transformations are combined with the item's <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#scale">scale</a>() and <a href="qgraphicsitem.html#transform">transform</a>() to map the item's coordinate system to the parent item.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#transformations">transformations</a>(), <a href="qgraphicsitem.html#scale">scale</a>(), <a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>(), and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<!-- @@@setTransformations -->
<!-- $$$setVisible[overload1]$$$setVisiblebool -->
<h3 class="fn" id="setVisible"><a name="setVisible"></a><span class="type">void</span> QGraphicsItem::<span class="name">setVisible</span>(<span class="type">bool</span> <i>visible</i>)</h3>
<p>If <i>visible</i> is true, the item is made visible. Otherwise, the item is made invisible. Invisible items are not painted, nor do they receive any events. In particular, mouse events pass right through invisible items, and are delivered to any item that may be behind. Invisible items are also unselectable, they cannot take input focus, and are not detected by <a href="qgraphicsscene.html">QGraphicsScene</a>'s item location functions.</p>
<p>If an item becomes invisible while grabbing the mouse, (i.e&#x2e;, while it is receiving mouse events,) it will automatically lose the mouse grab, and the grab is not regained by making the item visible again; it must receive a new mouse press to regain the mouse grab.</p>
<p>Similarly, an invisible item cannot have focus, so if the item has focus when it becomes invisible, it will lose focus, and the focus is not regained by simply making the item visible again.</p>
<p>If you hide a parent item, all its children will also be hidden. If you show a parent item, all children will be shown, unless they have been explicitly hidden (i.e&#x2e;, if you call setVisible(false) on a child, it will not be reshown even if its parent is hidden, and then shown again).</p>
<p>Items are visible by default; it is unnecessary to call setVisible() on a new item.</p>
<p><b>Note: </b>An item with opacity set to 0 will still be considered visible, although it will be treated like an invisible item: mouse events will pass through it, it will not be included in the items returned by <a href="qgraphicsview.html#items">QGraphicsView::items</a>(), and so on. However, the item will retain the focus.</p><p><b>See also </b><a href="qgraphicsitem.html#isVisible">isVisible</a>(), <a href="qgraphicsitem.html#show">show</a>(), <a href="qgraphicsitem.html#hide">hide</a>(), and <a href="qgraphicsitem.html#setOpacity">setOpacity</a>().</p>
<!-- @@@setVisible -->
<!-- $$$setX[overload1]$$$setXqreal -->
<h3 class="fn" id="setX"><a name="setX"></a><span class="type">void</span> QGraphicsItem::<span class="name">setX</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>)</h3>
<p>Set's the <i>x</i> coordinate of the item's position. Equivalent to calling <a href="qgraphicsitem.html#setPos">setPos</a>(x, <a href="qgraphicsitem.html#y">y</a>()).</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#x">x</a>() and <a href="qgraphicsitem.html#setPos">setPos</a>().</p>
<!-- @@@setX -->
<!-- $$$setY[overload1]$$$setYqreal -->
<h3 class="fn" id="setY"><a name="setY"></a><span class="type">void</span> QGraphicsItem::<span class="name">setY</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>)</h3>
<p>Set's the <i>y</i> coordinate of the item's position. Equivalent to calling <a href="qgraphicsitem.html#setPos">setPos</a>(<a href="qgraphicsitem.html#x">x</a>(), y).</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#y">y</a>(), <a href="qgraphicsitem.html#x">x</a>(), and <a href="qgraphicsitem.html#setPos">setPos</a>().</p>
<!-- @@@setY -->
<!-- $$$setZValue[overload1]$$$setZValueqreal -->
<h3 class="fn" id="setZValue"><a name="setZValue"></a><span class="type">void</span> QGraphicsItem::<span class="name">setZValue</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>z</i>)</h3>
<p>Sets the Z-value of the item to <i>z</i>. The Z value decides the stacking order of sibling (neighboring) items. A sibling item of high Z value will always be drawn on top of another sibling item with a lower Z value.</p>
<p>If you restore the Z value, the item's insertion order will decide its stacking order.</p>
<p>The Z-value does not affect the item's size in any way.</p>
<p>The default Z-value is 0.</p>
<p><b>See also </b><a href="qgraphicsitem.html#zValue">zValue</a>(), <a href="qgraphicsitem.html#sorting">Sorting</a>, <a href="qgraphicsitem.html#stackBefore">stackBefore</a>(), and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemStacksBehindParent</a>.</p>
<!-- @@@setZValue -->
<!-- $$$shape[overload1]$$$shape -->
<h3 class="fn" id="shape"><a name="shape"></a><code>[virtual] </code><span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> QGraphicsItem::<span class="name">shape</span>() const</h3>
<p>Returns the shape of this item as a <a href="../qtgui/qpainterpath.html">QPainterPath</a> in local coordinates. The shape is used for many things, including collision detection, hit tests, and for the <a href="qgraphicsscene.html#items">QGraphicsScene::items</a>() functions.</p>
<p>The default implementation calls <a href="qgraphicsitem.html#boundingRect">boundingRect</a>() to return a simple rectangular shape, but subclasses can reimplement this function to return a more accurate shape for non-rectangular items. For example, a round item may choose to return an elliptic shape for better collision detection. For example:</p>
<pre class="cpp">

  <span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> RoundItem<span class="operator">::</span>shape() <span class="keyword">const</span>
  {
      <span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> path;
      path<span class="operator">.</span>addEllipse(boundingRect());
      <span class="keyword">return</span> path;
  }

</pre>
<p>The outline of a shape can vary depending on the width and style of the pen used when drawing. If you want to include this outline in the item's shape, you can create a shape from the stroke using <a href="../qtgui/qpainterpathstroker.html">QPainterPathStroker</a>.</p>
<p>This function is called by the default implementations of <a href="qgraphicsitem.html#contains">contains</a>() and <a href="qgraphicsitem.html#collidesWithPath">collidesWithPath</a>().</p>
<p><b>See also </b><a href="qgraphicsitem.html#boundingRect">boundingRect</a>(), <a href="qgraphicsitem.html#contains">contains</a>(), <a href="qgraphicsitem.html#prepareGeometryChange">prepareGeometryChange</a>(), and <a href="../qtgui/qpainterpathstroker.html">QPainterPathStroker</a>.</p>
<!-- @@@shape -->
<!-- $$$show[overload1]$$$show -->
<h3 class="fn" id="show"><a name="show"></a><span class="type">void</span> QGraphicsItem::<span class="name">show</span>()</h3>
<p>Shows the item (items are visible by default).</p>
<p>This convenience function is equivalent to calling <code>setVisible(true)</code>.</p>
<p><b>See also </b><a href="qgraphicsitem.html#hide">hide</a>() and <a href="qgraphicsitem.html#setVisible">setVisible</a>().</p>
<!-- @@@show -->
<!-- $$$stackBefore[overload1]$$$stackBeforeconstQGraphicsItem* -->
<h3 class="fn" id="stackBefore"><a name="stackBefore"></a><span class="type">void</span> QGraphicsItem::<span class="name">stackBefore</span>(const <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>sibling</i>)</h3>
<p>Stacks this item before <i>sibling</i>, which must be a sibling item (i.e&#x2e;, the two items must share the same parent item, or must both be toplevel items). The <i>sibling</i> must have the same Z value as this item, otherwise calling this function will have no effect.</p>
<p>By default, all sibling items are stacked by insertion order (i.e&#x2e;, the first item you add is drawn before the next item you add). If two items' Z values are different, then the item with the highest Z value is drawn on top. When the Z values are the same, the insertion order will decide the stacking order.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setZValue">setZValue</a>(), <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemStacksBehindParent</a>, and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p>
<!-- @@@stackBefore -->
<!-- $$$toGraphicsObject[overload1]$$$toGraphicsObject -->
<h3 class="fn" id="toGraphicsObject"><a name="toGraphicsObject"></a><span class="type"><a href="qgraphicsobject.html">QGraphicsObject</a></span> *QGraphicsItem::<span class="name">toGraphicsObject</span>()</h3>
<p>Return the graphics item cast to a <a href="qgraphicsobject.html">QGraphicsObject</a>, if the class is actually a graphics object, 0 otherwise.</p>
<p>This function was introduced in  Qt 4.6.</p>
<!-- @@@toGraphicsObject -->
<!-- $$$toGraphicsObject$$$toGraphicsObject -->
<h3 class="fn" id="toGraphicsObject-1"><a name="toGraphicsObject-1"></a>const <span class="type"><a href="qgraphicsobject.html">QGraphicsObject</a></span> *QGraphicsItem::<span class="name">toGraphicsObject</span>() const</h3>
<p>Return the graphics item cast to a <a href="qgraphicsobject.html">QGraphicsObject</a>, if the class is actually a graphics object, 0 otherwise.</p>
<p>This function was introduced in  Qt 4.6.</p>
<!-- @@@toGraphicsObject -->
<!-- $$$toolTip[overload1]$$$toolTip -->
<h3 class="fn" id="toolTip"><a name="toolTip"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QGraphicsItem::<span class="name">toolTip</span>() const</h3>
<p>Returns the item's tool tip, or an empty <a href="../qtcore/qstring.html">QString</a> if no tool tip has been set.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setToolTip">setToolTip</a>() and <a href="qtooltip.html">QToolTip</a>.</p>
<!-- @@@toolTip -->
<!-- $$$topLevelItem[overload1]$$$topLevelItem -->
<h3 class="fn" id="topLevelItem"><a name="topLevelItem"></a><span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *QGraphicsItem::<span class="name">topLevelItem</span>() const</h3>
<p>Returns this item's top-level item. The top-level item is the item's topmost ancestor item whose parent is 0. If an item has no parent, its own pointer is returned (i.e&#x2e;, a top-level item is its own top-level item).</p>
<p><b>See also </b><a href="qgraphicsitem.html#parentItem">parentItem</a>().</p>
<!-- @@@topLevelItem -->
<!-- $$$topLevelWidget[overload1]$$$topLevelWidget -->
<h3 class="fn" id="topLevelWidget"><a name="topLevelWidget"></a><span class="type"><a href="qgraphicswidget.html">QGraphicsWidget</a></span> *QGraphicsItem::<span class="name">topLevelWidget</span>() const</h3>
<p>Returns a pointer to the item's top level widget (i.e&#x2e;, the item's ancestor whose parent is 0, or whose parent is not a widget), or 0 if this item does not have a top level widget. If the item is its own top level widget, this function returns a pointer to the item itself.</p>
<p>This function was introduced in  Qt 4.4.</p>
<!-- @@@topLevelWidget -->
<!-- $$$transform[overload1]$$$transform -->
<h3 class="fn" id="transform"><a name="transform"></a><span class="type"><a href="../qtgui/qtransform.html">QTransform</a></span> QGraphicsItem::<span class="name">transform</span>() const</h3>
<p>Returns this item's transformation matrix.</p>
<p>The transformation matrix is combined with the item's <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#scale">scale</a>() and <a href="qgraphicsitem.html#transformations">transformations</a>() into a combined transformations for the item.</p>
<p>The default transformation matrix is an identity matrix.</p>
<p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setTransform">setTransform</a>() and <a href="qgraphicsitem.html#sceneTransform">sceneTransform</a>().</p>
<!-- @@@transform -->
<!-- $$$transformOriginPoint[overload1]$$$transformOriginPoint -->
<h3 class="fn" id="transformOriginPoint"><a name="transformOriginPoint"></a><span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> QGraphicsItem::<span class="name">transformOriginPoint</span>() const</h3>
<p>Returns the origin point for the transformation in item coordinates.</p>
<p>The default is <a href="../qtcore/qpointf.html">QPointF</a>(0,0).</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setTransformOriginPoint">setTransformOriginPoint</a>() and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<!-- @@@transformOriginPoint -->
<!-- $$$transformations[overload1]$$$transformations -->
<h3 class="fn" id="transformations"><a name="transformations"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qgraphicstransform.html">QGraphicsTransform</a></span> *&gt; QGraphicsItem::<span class="name">transformations</span>() const</h3>
<p>Returns a list of graphics transforms that currently apply to this item.</p>
<p><a href="qgraphicstransform.html">QGraphicsTransform</a> is for applying and controlling a chain of individual transformation operations on an item. It's particularly useful in animations, where each transform operation needs to be interpolated independently, or differently.</p>
<p>The transformations are combined with the item's <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#scale">scale</a>() and <a href="qgraphicsitem.html#transform">transform</a>() to map the item's coordinate system to the parent item.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setTransformations">setTransformations</a>(), <a href="qgraphicsitem.html#scale">scale</a>(), <a href="qgraphicsitem.html#rotation">rotation</a>(), <a href="qgraphicsitem.html#transformOriginPoint">transformOriginPoint</a>(), and <a href="qgraphicsitem.html#transformations">Transformations</a>.</p>
<!-- @@@transformations -->
<!-- $$$type[overload1]$$$type -->
<h3 class="fn" id="type"><a name="type"></a><code>[virtual] </code><span class="type">int</span> QGraphicsItem::<span class="name">type</span>() const</h3>
<p>Returns the type of an item as an int. All standard graphicsitem classes are associated with a unique value; see <a href="qgraphicsitem.html#Type-var">QGraphicsItem::Type</a>. This type information is used by <a href="qgraphicsitem.html#qgraphicsitem_cast">qgraphicsitem_cast</a>() to distinguish between types.</p>
<p>The default implementation (in <a href="qgraphicsitem.html">QGraphicsItem</a>) returns <a href="qgraphicsitem.html#UserType-var">UserType</a>.</p>
<p>To enable use of <a href="qgraphicsitem.html#qgraphicsitem_cast">qgraphicsitem_cast</a>() with a custom item, reimplement this function and declare a Type enum value equal to your custom item's type. Custom items must return a value larger than or equal to <a href="qgraphicsitem.html#UserType-var">UserType</a> (65536).</p>
<p>For example:</p>
<pre class="cpp">

  <span class="keyword">class</span> CustomItem : <span class="keyword">public</span> <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span>
  {
  <span class="keyword">public</span>:
     <span class="keyword">enum</span> { Type <span class="operator">=</span> UserType <span class="operator">+</span> <span class="number">1</span> };

     <span class="type">int</span> type() <span class="keyword">const</span>
     {
         <span class="comment">// Enable the use of qgraphicsitem_cast with this item.</span>
         <span class="keyword">return</span> Type;
     }
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
  };

</pre>
<p><b>See also </b><a href="qgraphicsitem.html#UserType-var">UserType</a>.</p>
<!-- @@@type -->
<!-- $$$ungrabKeyboard[overload1]$$$ungrabKeyboard -->
<h3 class="fn" id="ungrabKeyboard"><a name="ungrabKeyboard"></a><span class="type">void</span> QGraphicsItem::<span class="name">ungrabKeyboard</span>()</h3>
<p>Releases the keyboard grab.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsitem.html#grabKeyboard">grabKeyboard</a>() and <a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>().</p>
<!-- @@@ungrabKeyboard -->
<!-- $$$ungrabMouse[overload1]$$$ungrabMouse -->
<h3 class="fn" id="ungrabMouse"><a name="ungrabMouse"></a><span class="type">void</span> QGraphicsItem::<span class="name">ungrabMouse</span>()</h3>
<p>Releases the mouse grab.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsitem.html#grabMouse">grabMouse</a>() and <a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a>().</p>
<!-- @@@ungrabMouse -->
<!-- $$$unsetCursor[overload1]$$$unsetCursor -->
<h3 class="fn" id="unsetCursor"><a name="unsetCursor"></a><span class="type">void</span> QGraphicsItem::<span class="name">unsetCursor</span>()</h3>
<p>Clears the cursor from this item.</p>
<p><b>See also </b><a href="qgraphicsitem.html#hasCursor">hasCursor</a>() and <a href="qgraphicsitem.html#setCursor">setCursor</a>().</p>
<!-- @@@unsetCursor -->
<!-- $$$update[overload1]$$$updateconstQRectF& -->
<h3 class="fn" id="update"><a name="update"></a><span class="type">void</span> QGraphicsItem::<span class="name">update</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i> = QRectF())</h3>
<p>Schedules a redraw of the area covered by <i>rect</i> in this item. You can call this function whenever your item needs to be redrawn, such as if it changes appearance or size.</p>
<p>This function does not cause an immediate paint; instead it schedules a paint request that is processed by <a href="qgraphicsview.html">QGraphicsView</a> after control reaches the event loop. The item will only be redrawn if it is visible in any associated view.</p>
<p>As a side effect of the item being repainted, other items that overlap the area <i>rect</i> may also be repainted.</p>
<p>If the item is invisible (i.e&#x2e;, <a href="qgraphicsitem.html#isVisible">isVisible</a>() returns <code>false</code>), this function does nothing.</p>
<p><b>See also </b><a href="qgraphicsitem.html#paint">paint</a>() and <a href="qgraphicsitem.html#boundingRect">boundingRect</a>().</p>
<!-- @@@update -->
<!-- $$$update$$$updateqrealqrealqrealqreal -->
<h3 class="fn" id="update-1"><a name="update-1"></a><span class="type">void</span> QGraphicsItem::<span class="name">update</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>width</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>height</i>)</h3>
<p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling update(<a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>width</i>, <i>height</i>)).</p>
<!-- @@@update -->
<!-- $$$updateMicroFocus[overload1]$$$updateMicroFocus -->
<h3 class="fn" id="updateMicroFocus"><a name="updateMicroFocus"></a><code>[protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">updateMicroFocus</span>()</h3>
<p>Updates the item's micro focus.</p>
<p>This function was introduced in  Qt 4.7.</p>
<p><b>See also </b><a href="../qtgui/qinputmethod.html">QInputMethod</a>.</p>
<!-- @@@updateMicroFocus -->
<!-- $$$wheelEvent[overload1]$$$wheelEventQGraphicsSceneWheelEvent* -->
<h3 class="fn" id="wheelEvent"><a name="wheelEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsItem::<span class="name">wheelEvent</span>(<span class="type"><a href="qgraphicsscenewheelevent.html">QGraphicsSceneWheelEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for event <i>event</i>, can be reimplemented to receive wheel events for this item. If you reimplement this function, <i>event</i> will be accepted by default.</p>
<p>If you ignore the event, (i.e&#x2e;, by calling <a href="../qtcore/qevent.html#ignore">QEvent::ignore</a>(),) it will propagate to any item beneath this item. If no items accept the event, it will be ignored by the scene, and propagate to the view (e.g&#x2e;, the view's vertical scroll bar).</p>
<p>The default implementation ignores the event.</p>
<p><b>See also </b><a href="qgraphicsitem.html#sceneEvent">sceneEvent</a>().</p>
<!-- @@@wheelEvent -->
<!-- $$$window[overload1]$$$window -->
<h3 class="fn" id="window"><a name="window"></a><span class="type"><a href="qgraphicswidget.html">QGraphicsWidget</a></span> *QGraphicsItem::<span class="name">window</span>() const</h3>
<p>Returns the item's window, or 0 if this item does not have a window. If the item is a window, it will return itself. Otherwise it will return the closest ancestor that is a window.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsitem.html#isWindow">QGraphicsWidget::isWindow</a>().</p>
<!-- @@@window -->
<!-- $$$x[overload1]$$$x -->
<h3 class="fn" id="x"><a name="x"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QGraphicsItem::<span class="name">x</span>() const</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#pos">pos</a>().x().</p>
<p><b>See also </b><a href="qgraphicsitem.html#setX">setX</a>() and <a href="qgraphicsitem.html#y">y</a>().</p>
<!-- @@@x -->
<!-- $$$y[overload1]$$$y -->
<h3 class="fn" id="y"><a name="y"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QGraphicsItem::<span class="name">y</span>() const</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsitem.html#pos">pos</a>().y().</p>
<p><b>See also </b><a href="qgraphicsitem.html#setY">setY</a>() and <a href="qgraphicsitem.html#x">x</a>().</p>
<!-- @@@y -->
<!-- $$$zValue[overload1]$$$zValue -->
<h3 class="fn" id="zValue"><a name="zValue"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QGraphicsItem::<span class="name">zValue</span>() const</h3>
<p>Returns the Z-value of the item. The Z-value affects the stacking order of sibling (neighboring) items.</p>
<p>The default Z-value is 0.</p>
<p><b>See also </b><a href="qgraphicsitem.html#setZValue">setZValue</a>(), <a href="qgraphicsitem.html#sorting">Sorting</a>, <a href="qgraphicsitem.html#stackBefore">stackBefore</a>(), and <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemStacksBehindParent</a>.</p>
<!-- @@@zValue -->
</div>
<div class="vars">
<h2>Member Variable Documentation</h2>
<!-- $$$Type -->
<h3 class="fn" id="Type-var"><a name="Type-var"></a>const <span class="type">int</span> QGraphicsItem::<span class="name">Type</span></h3>
<p>The type value returned by the virtual <a href="qgraphicsitem.html#type">type</a>() function in standard graphics item classes in Qt. All such standard graphics item classes in Qt are associated with a unique value for Type, e.g&#x2e; the value returned by <a href="qgraphicspathitem.html#type">QGraphicsPathItem::type</a>() is 2.</p>
<pre class="cpp">

  <span class="keyword">class</span> <span class="type"><a href="qgraphicspathitem.html">QGraphicsPathItem</a></span> : <span class="keyword">public</span> <span class="type"><a href="qabstractgraphicsshapeitem.html">QAbstractGraphicsShapeItem</a></span>
  {
   <span class="keyword">public</span>:
    <span class="keyword">enum</span> { Type <span class="operator">=</span> <span class="number">2</span> };
      <span class="type">int</span> type() <span class="keyword">const</span> { <span class="keyword">return</span> Type; }
    <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
  };

</pre>
<!-- @@@Type -->
<!-- $$$UserType -->
<h3 class="fn" id="UserType-var"><a name="UserType-var"></a>const <span class="type">int</span> QGraphicsItem::<span class="name">UserType</span></h3>
<p>The lowest permitted type value for custom items (subclasses of <a href="qgraphicsitem.html">QGraphicsItem</a> or any of the standard items). This value is used in conjunction with a reimplementation of <a href="qgraphicsitem.html#type">QGraphicsItem::type</a>() and declaring a Type enum value. Example:</p>
<pre class="cpp">

  <span class="keyword">class</span> CustomItem : <span class="keyword">public</span> <span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span>
  {
  <span class="keyword">public</span>:
     <span class="keyword">enum</span> { Type <span class="operator">=</span> UserType <span class="operator">+</span> <span class="number">1</span> };

     <span class="type">int</span> type() <span class="keyword">const</span>
     {
         <span class="comment">// Enable the use of qgraphicsitem_cast with this item.</span>
         <span class="keyword">return</span> Type;
     }
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
  };

</pre>
<p><b>Note: </b>UserType = 65536</p><!-- @@@UserType -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$qgraphicsitem_cast[overload1]$$$qgraphicsitem_castQGraphicsItem* -->
<h3 class="fn" id="qgraphicsitem_cast"><a name="qgraphicsitem_cast"></a><span class="type">T</span> <span class="name">qgraphicsitem_cast</span>(<span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>item</i>)</h3>
<p>Returns the given <i>item</i> cast to type T if <i>item</i> is of type T; otherwise, 0 is returned.</p>
<p><b>Note: </b>To make this function work correctly with custom items, reimplement the <a href="qgraphicsitem.html#type">type()</a> function for each custom <a href="qgraphicsitem.html">QGraphicsItem</a> subclass.</p><p>This function was introduced in  Qt 4.2.</p>
<p><b>See also </b><a href="qgraphicsitem.html#type">QGraphicsItem::type</a>() and <a href="qgraphicsitem.html#UserType-var">QGraphicsItem::UserType</a>.</p>
<!-- @@@qgraphicsitem_cast -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    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.<br>    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. </p>
</div>
</body>
</html>