Sophie

Sophie

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

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" />
<!-- qgraphicsscene.cpp -->
  <title>QGraphicsScene 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 >QGraphicsScene</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="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#reimplemented-protected-functions">Reimplemented Protected Functions</a></li>
<li class="level1"><a href="#protected-slots">Protected Slots</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#event-handling-and-propagation">Event Handling and Propagation</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QGraphicsScene Class</h1>
<!-- $$$QGraphicsScene-brief -->
<p>The <a href="qgraphicsscene.html">QGraphicsScene</a> class provides a surface for managing a large number of 2D graphical items. <a href="#details">More...</a></p>
<!-- @@@QGraphicsScene -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QGraphicsScene&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"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="../qtcore/qobject.html">QObject</a></td></tr></table></div><ul>
<li><a href="qgraphicsscene-members.html">List of all members, including inherited members</a></li>
<li><a href="qgraphicsscene-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="qgraphicsscene.html#ItemIndexMethod-enum">ItemIndexMethod</a></b> { BspTreeIndex, NoIndex }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#SceneLayer-enum">SceneLayer</a></b> { ItemLayer, BackgroundLayer, ForegroundLayer, AllLayers }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#SceneLayer-enum">SceneLayers</a></b></td></tr>
</table></div>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<div class="table"><table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qgraphicsscene.html#backgroundBrush-prop">backgroundBrush</a></b> : QBrush</li>
<li class="fn"><b><a href="qgraphicsscene.html#bspTreeDepth-prop">bspTreeDepth</a></b> : int</li>
<li class="fn"><b><a href="qgraphicsscene.html#font-prop">font</a></b> : QFont</li>
<li class="fn"><b><a href="qgraphicsscene.html#foregroundBrush-prop">foregroundBrush</a></b> : QBrush</li>
<li class="fn"><b><a href="qgraphicsscene.html#itemIndexMethod-prop">itemIndexMethod</a></b> : ItemIndexMethod</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qgraphicsscene.html#minimumRenderSize-prop">minimumRenderSize</a></b> : qreal</li>
<li class="fn"><b><a href="qgraphicsscene.html#palette-prop">palette</a></b> : QPalette</li>
<li class="fn"><b><a href="qgraphicsscene.html#sceneRect-prop">sceneRect</a></b> : QRectF</li>
<li class="fn"><b><a href="qgraphicsscene.html#stickyFocus-prop">stickyFocus</a></b> : bool</li>
</ul>
</td></tr>
</table></div>
<ul>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
</ul>
<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="qgraphicsscene.html#QGraphicsScene">QGraphicsScene</a></b>(QObject *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#QGraphicsScene-1">QGraphicsScene</a></b>(const QRectF &amp;<i>sceneRect</i>, QObject *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#QGraphicsScene-2">QGraphicsScene</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>width</i>, qreal <i>height</i>, QObject *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#dtor.QGraphicsScene">~QGraphicsScene</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#activePanel">activePanel</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsWidget *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#activeWindow">activeWindow</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsEllipseItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#addEllipse">addEllipse</a></b>(const QRectF &amp;<i>rect</i>, const QPen &amp;<i>pen</i> = QPen(), const QBrush &amp;<i>brush</i> = QBrush())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsEllipseItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#addEllipse-1">addEllipse</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>, const QPen &amp;<i>pen</i> = QPen(), const QBrush &amp;<i>brush</i> = QBrush())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#addItem">addItem</a></b>(QGraphicsItem *<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsLineItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#addLine">addLine</a></b>(const QLineF &amp;<i>line</i>, const QPen &amp;<i>pen</i> = QPen())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsLineItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#addLine-1">addLine</a></b>(qreal <i>x1</i>, qreal <i>y1</i>, qreal <i>x2</i>, qreal <i>y2</i>, const QPen &amp;<i>pen</i> = QPen())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsPathItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#addPath">addPath</a></b>(const QPainterPath &amp;<i>path</i>, const QPen &amp;<i>pen</i> = QPen(), const QBrush &amp;<i>brush</i> = QBrush())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsPixmapItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#addPixmap">addPixmap</a></b>(const QPixmap &amp;<i>pixmap</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsPolygonItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#addPolygon">addPolygon</a></b>(const QPolygonF &amp;<i>polygon</i>, const QPen &amp;<i>pen</i> = QPen(), const QBrush &amp;<i>brush</i> = QBrush())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsRectItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#addRect">addRect</a></b>(const QRectF &amp;<i>rect</i>, const QPen &amp;<i>pen</i> = QPen(), const QBrush &amp;<i>brush</i> = QBrush())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsRectItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#addRect-1">addRect</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>, const QPen &amp;<i>pen</i> = QPen(), const QBrush &amp;<i>brush</i> = QBrush())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsSimpleTextItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#addSimpleText">addSimpleText</a></b>(const QString &amp;<i>text</i>, const QFont &amp;<i>font</i> = QFont())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsTextItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#addText">addText</a></b>(const QString &amp;<i>text</i>, const QFont &amp;<i>font</i> = QFont())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsProxyWidget *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#addWidget">addWidget</a></b>(QWidget *<i>widget</i>, Qt::WindowFlags <i>wFlags</i> = Qt::WindowFlags())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QBrush </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#backgroundBrush-prop">backgroundBrush</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#bspTreeDepth-prop">bspTreeDepth</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#clearFocus">clearFocus</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QGraphicsItem *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#collidingItems">collidingItems</a></b>(const QGraphicsItem *<i>item</i>, Qt::ItemSelectionMode <i>mode</i> = Qt::IntersectsItemShape) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsItemGroup *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#createItemGroup">createItemGroup</a></b>(const QList&lt;QGraphicsItem *&gt; &amp;<i>items</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#destroyItemGroup">destroyItemGroup</a></b>(QGraphicsItemGroup *<i>group</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#focusItem">focusItem</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#font-prop">font</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QBrush </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#foregroundBrush-prop">foregroundBrush</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#hasFocus">hasFocus</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#height">height</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#inputMethodQuery">inputMethodQuery</a></b>(Qt::InputMethodQuery <i>query</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#invalidate-1">invalidate</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>, SceneLayers <i>layers</i> = AllLayers)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#isActive">isActive</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#itemAt">itemAt</a></b>(const QPointF &amp;<i>position</i>, const QTransform &amp;<i>deviceTransform</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#itemAt-3">itemAt</a></b>(qreal <i>x</i>, qreal <i>y</i>, const QTransform &amp;<i>deviceTransform</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> ItemIndexMethod </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#itemIndexMethod-prop">itemIndexMethod</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QGraphicsItem *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#items">items</a></b>(Qt::SortOrder <i>order</i> = Qt::DescendingOrder) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QGraphicsItem *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#items-1">items</a></b>(const QPointF &amp;<i>pos</i>, Qt::ItemSelectionMode <i>mode</i> = Qt::IntersectsItemShape, Qt::SortOrder <i>order</i> = Qt::DescendingOrder, const QTransform &amp;<i>deviceTransform</i> = QTransform()) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QGraphicsItem *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#items-2">items</a></b>(const QRectF &amp;<i>rect</i>, Qt::ItemSelectionMode <i>mode</i> = Qt::IntersectsItemShape, Qt::SortOrder <i>order</i> = Qt::DescendingOrder, const QTransform &amp;<i>deviceTransform</i> = QTransform()) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QGraphicsItem *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#items-3">items</a></b>(const QPolygonF &amp;<i>polygon</i>, Qt::ItemSelectionMode <i>mode</i> = Qt::IntersectsItemShape, Qt::SortOrder <i>order</i> = Qt::DescendingOrder, const QTransform &amp;<i>deviceTransform</i> = QTransform()) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QGraphicsItem *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#items-4">items</a></b>(const QPainterPath &amp;<i>path</i>, Qt::ItemSelectionMode <i>mode</i> = Qt::IntersectsItemShape, Qt::SortOrder <i>order</i> = Qt::DescendingOrder, const QTransform &amp;<i>deviceTransform</i> = QTransform()) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QGraphicsItem *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#items-6">items</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>, Qt::ItemSelectionMode <i>mode</i>, Qt::SortOrder <i>order</i>, const QTransform &amp;<i>deviceTransform</i> = QTransform()) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#itemsBoundingRect">itemsBoundingRect</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#minimumRenderSize-prop">minimumRenderSize</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsItem *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#mouseGrabberItem">mouseGrabberItem</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPalette </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#palette-prop">palette</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#removeItem">removeItem</a></b>(QGraphicsItem *<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#render">render</a></b>(QPainter *<i>painter</i>, const QRectF &amp;<i>target</i> = QRectF(), const QRectF &amp;<i>source</i> = QRectF(), Qt::AspectRatioMode <i>aspectRatioMode</i> = Qt::KeepAspectRatio)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#sceneRect-prop">sceneRect</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QGraphicsItem *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#selectedItems">selectedItems</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#selectionArea">selectionArea</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#sendEvent">sendEvent</a></b>(QGraphicsItem *<i>item</i>, QEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#setActivePanel">setActivePanel</a></b>(QGraphicsItem *<i>item</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#setActiveWindow">setActiveWindow</a></b>(QGraphicsWidget *<i>widget</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#backgroundBrush-prop">setBackgroundBrush</a></b>(const QBrush &amp;<i>brush</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#bspTreeDepth-prop">setBspTreeDepth</a></b>(int <i>depth</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.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="qgraphicsscene.html#setFocusItem">setFocusItem</a></b>(QGraphicsItem *<i>item</i>, Qt::FocusReason <i>focusReason</i> = Qt::OtherFocusReason)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#font-prop">setFont</a></b>(const QFont &amp;<i>font</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#foregroundBrush-prop">setForegroundBrush</a></b>(const QBrush &amp;<i>brush</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#itemIndexMethod-prop">setItemIndexMethod</a></b>(ItemIndexMethod <i>method</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#minimumRenderSize-prop">setMinimumRenderSize</a></b>(qreal <i>minSize</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#palette-prop">setPalette</a></b>(const QPalette &amp;<i>palette</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#sceneRect-prop">setSceneRect</a></b>(const QRectF &amp;<i>rect</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#sceneRect-prop">setSceneRect</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#setSelectionArea">setSelectionArea</a></b>(const QPainterPath &amp;<i>path</i>, const QTransform &amp;<i>deviceTransform</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#setSelectionArea-1">setSelectionArea</a></b>(const QPainterPath &amp;<i>path</i>, Qt::ItemSelectionMode <i>mode</i> = Qt::IntersectsItemShape, const QTransform &amp;<i>deviceTransform</i> = QTransform())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#setSelectionArea-2">setSelectionArea</a></b>(const QPainterPath &amp;<i>path</i>, Qt::ItemSelectionOperation <i>selectionOperation</i>, Qt::ItemSelectionMode <i>mode</i> = Qt::IntersectsItemShape, const QTransform &amp;<i>deviceTransform</i> = QTransform())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#stickyFocus-prop">setStickyFocus</a></b>(bool <i>enabled</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#setStyle">setStyle</a></b>(QStyle *<i>style</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#stickyFocus-prop">stickyFocus</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStyle *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#style">style</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#update-1">update</a></b>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QGraphicsView *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#views">views</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#width">width</a></b>() const</td></tr>
</table></div>
<ul>
<li class="fn">32 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
</ul>
<a name="public-slots"></a>
<h2 id="public-slots">Public Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#advance">advance</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#clear">clear</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#clearSelection">clearSelection</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#invalidate">invalidate</a></b>(const QRectF &amp;<i>rect</i> = QRectF(), SceneLayers <i>layers</i> = AllLayers)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#update">update</a></b>(const QRectF &amp;<i>rect</i> = QRectF())</td></tr>
</table></div>
<ul>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#changed">changed</a></b>(const QList&lt;QRectF&gt; &amp;<i>region</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#focusItemChanged">focusItemChanged</a></b>(QGraphicsItem *<i>newFocusItem</i>, QGraphicsItem *<i>oldFocusItem</i>, Qt::FocusReason <i>reason</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#sceneRectChanged">sceneRectChanged</a></b>(const QRectF &amp;<i>rect</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#selectionChanged">selectionChanged</a></b>()</td></tr>
</table></div>
<ul>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
</ul>
<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="qgraphicsscene.html#contextMenuEvent">contextMenuEvent</a></b>(QGraphicsSceneContextMenuEvent *<i>contextMenuEvent</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.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="qgraphicsscene.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="qgraphicsscene.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="qgraphicsscene.html#drawBackground">drawBackground</a></b>(QPainter *<i>painter</i>, const QRectF &amp;<i>rect</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#drawForeground">drawForeground</a></b>(QPainter *<i>painter</i>, const QRectF &amp;<i>rect</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.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="qgraphicsscene.html#focusInEvent">focusInEvent</a></b>(QFocusEvent *<i>focusEvent</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#focusOutEvent">focusOutEvent</a></b>(QFocusEvent *<i>focusEvent</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#helpEvent">helpEvent</a></b>(QGraphicsSceneHelpEvent *<i>helpEvent</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#inputMethodEvent">inputMethodEvent</a></b>(QInputMethodEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#keyPressEvent">keyPressEvent</a></b>(QKeyEvent *<i>keyEvent</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#keyReleaseEvent">keyReleaseEvent</a></b>(QKeyEvent *<i>keyEvent</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a></b>(QGraphicsSceneMouseEvent *<i>mouseEvent</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#mouseMoveEvent">mouseMoveEvent</a></b>(QGraphicsSceneMouseEvent *<i>mouseEvent</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#mousePressEvent">mousePressEvent</a></b>(QGraphicsSceneMouseEvent *<i>mouseEvent</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#mouseReleaseEvent">mouseReleaseEvent</a></b>(QGraphicsSceneMouseEvent *<i>mouseEvent</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#wheelEvent">wheelEvent</a></b>(QGraphicsSceneWheelEvent *<i>wheelEvent</i>)</td></tr>
</table></div>
<a name="reimplemented-protected-functions"></a>
<h2 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#event">event</a></b>(QEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#eventFilter">eventFilter</a></b>(QObject *<i>watched</i>, QEvent *<i>event</i>)</td></tr>
</table></div>
<ul>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="protected-slots"></a>
<h2 id="protected-slots">Protected Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsscene.html#focusNextPrevChild">focusNextPrevChild</a></b>(bool <i>next</i>)</td></tr>
</table></div>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 public variable inherited from <a href="../qtcore/qobject.html#public-variables">QObject</a></li>
<li class="fn">10 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
<li class="fn">2 protected variables inherited from <a href="../qtcore/qobject.html#protected-variables">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QGraphicsScene-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qgraphicsscene.html">QGraphicsScene</a> class provides a surface for managing a large number of 2D graphical items.</p>
<p>The class serves as a container for QGraphicsItems. It is used together with <a href="qgraphicsview.html">QGraphicsView</a> for visualizing graphical items, such as lines, rectangles, text, or even custom items, on a 2D surface. <a href="qgraphicsscene.html">QGraphicsScene</a> is part of the <a href="graphicsview.html">Graphics View Framework</a>.</p>
<p><a href="qgraphicsscene.html">QGraphicsScene</a> also provides functionality that lets you efficiently determine both the location of items, and for determining what items are visible within an arbitrary area on the scene. With the <a href="qgraphicsview.html">QGraphicsView</a> widget, you can either visualize the whole scene, or zoom in and view only parts of the scene.</p>
<p>Example:</p>
<pre class="cpp">

  <span class="type"><a href="qgraphicsscene.html#QGraphicsScene">QGraphicsScene</a></span> scene;
  scene<span class="operator">.</span>addText(<span class="string">&quot;Hello, world!&quot;</span>);

  <span class="type"><a href="qgraphicsview.html">QGraphicsView</a></span> view(<span class="operator">&amp;</span>scene);
  view<span class="operator">.</span>show();

</pre>
<p>Note that <a href="qgraphicsscene.html">QGraphicsScene</a> has no visual appearance of its own; it only manages the items. You need to create a <a href="qgraphicsview.html">QGraphicsView</a> widget to visualize the scene.</p>
<p>To add items to a scene, you start off by constructing a <a href="qgraphicsscene.html">QGraphicsScene</a> object. Then, you have two options: either add your existing <a href="qgraphicsitem.html">QGraphicsItem</a> objects by calling <a href="qgraphicsscene.html#addItem">addItem</a>(), or you can call one of the convenience functions <a href="qgraphicsscene.html#addEllipse">addEllipse</a>(), <a href="qgraphicsscene.html#addLine">addLine</a>(), <a href="qgraphicsscene.html#addPath">addPath</a>(), <a href="qgraphicsscene.html#addPixmap">addPixmap</a>(), <a href="qgraphicsscene.html#addPolygon">addPolygon</a>(), <a href="qgraphicsscene.html#addRect">addRect</a>(), or <a href="qgraphicsscene.html#addText">addText</a>(), which all return a pointer to the newly added item. The dimensions of the items added with these functions are relative to the item's coordinate system, and the items position is initialized to (0, 0) in the scene.</p>
<p>You can then visualize the scene using <a href="qgraphicsview.html">QGraphicsView</a>. When the scene changes, (e.g&#x2e;, when an item moves or is transformed) <a href="qgraphicsscene.html">QGraphicsScene</a> emits the <a href="qgraphicsscene.html#changed">changed</a>() signal. To remove an item, call <a href="qgraphicsscene.html#removeItem">removeItem</a>().</p>
<p><a href="qgraphicsscene.html">QGraphicsScene</a> uses an indexing algorithm to manage the location of items efficiently. By default, a BSP (Binary Space Partitioning) tree is used; an algorithm suitable for large scenes where most items remain static (i.e&#x2e;, do not move around). You can choose to disable this index by calling <a href="qgraphicsscene.html#itemIndexMethod-prop">setItemIndexMethod</a>(). For more information about the available indexing algorithms, see the <a href="qgraphicsscene.html#itemIndexMethod-prop">itemIndexMethod</a> property.</p>
<p>The scene's bounding rect is set by calling <a href="qgraphicsscene.html#sceneRect-prop">setSceneRect</a>(). Items can be placed at any position on the scene, and the size of the scene is by default unlimited. The scene rect is used only for internal bookkeeping, maintaining the scene's item index. If the scene rect is unset, <a href="qgraphicsscene.html">QGraphicsScene</a> will use the bounding area of all items, as returned by <a href="qgraphicsscene.html#itemsBoundingRect">itemsBoundingRect</a>(), as the scene rect. However, <a href="qgraphicsscene.html#itemsBoundingRect">itemsBoundingRect</a>() is a relatively time consuming function, as it operates by collecting positional information for every item on the scene. Because of this, you should always set the scene rect when operating on large scenes.</p>
<p>One of <a href="qgraphicsscene.html">QGraphicsScene</a>'s greatest strengths is its ability to efficiently determine the location of items. Even with millions of items on the scene, the <a href="qgraphicsscene.html#items">items</a>() functions can determine the location of an item within a few milliseconds. There are several overloads to <a href="qgraphicsscene.html#items">items</a>(): one that finds items at a certain position, one that finds items inside or intersecting with a polygon or a rectangle, and more. The list of returned items is sorted by stacking order, with the topmost item being the first item in the list. For convenience, there is also an <a href="qgraphicsscene.html#itemAt">itemAt</a>() function that returns the topmost item at a given position.</p>
<p><a href="qgraphicsscene.html">QGraphicsScene</a> maintains selection information for the scene. To select items, call <a href="qgraphicsscene.html#setSelectionArea">setSelectionArea</a>(), and to clear the current selection, call <a href="qgraphicsscene.html#clearSelection">clearSelection</a>(). Call <a href="qgraphicsscene.html#selectedItems">selectedItems</a>() to get the list of all selected items.</p>
<a name="event-handling-and-propagation"></a>
<h3 >Event Handling and Propagation</h3>
<p>Another responsibility that <a href="qgraphicsscene.html">QGraphicsScene</a> has, is to propagate events from <a href="qgraphicsview.html">QGraphicsView</a>. To send an event to a scene, you construct an event that inherits <a href="../qtcore/qevent.html">QEvent</a>, and then send it using, for example, QApplication::sendEvent(). <a href="qgraphicsscene.html#event">event</a>() is responsible for dispatching the event to the individual items. Some common events are handled by convenience event handlers. For example, key press events are handled by <a href="qgraphicsscene.html#keyPressEvent">keyPressEvent</a>(), and mouse press events are handled by <a href="qgraphicsscene.html#mousePressEvent">mousePressEvent</a>().</p>
<p>Key events are delivered to the <i>focus item</i>. To set the focus item, you can either call <a href="qgraphicsscene.html#setFocusItem">setFocusItem</a>(), passing an item that accepts focus, or the item itself can call <a href="qgraphicsitem.html#setFocus">QGraphicsItem::setFocus</a>(). Call <a href="qgraphicsscene.html#focusItem">focusItem</a>() to get the current focus item. For compatibility with widgets, the scene also maintains its own focus information. By default, the scene does not have focus, and all key events are discarded. If <a href="qgraphicsscene.html#setFocus">setFocus</a>() is called, or if an item on the scene gains focus, the scene automatically gains focus. If the scene has focus, <a href="qgraphicsscene.html#hasFocus">hasFocus</a>() will return true, and key events will be forwarded to the focus item, if any. If the scene loses focus, (i.e&#x2e;, someone calls <a href="qgraphicsscene.html#clearFocus">clearFocus</a>()) while an item has focus, the scene will maintain its item focus information, and once the scene regains focus, it will make sure the last focus item regains focus.</p>
<p>For mouse-over effects, <a href="qgraphicsscene.html">QGraphicsScene</a> dispatches <i>hover events</i>. If an item accepts hover events (see <a href="qgraphicsitem.html#acceptHoverEvents">QGraphicsItem::acceptHoverEvents</a>()), it will receive a <a href="../qtcore/qevent.html#Type-enum">GraphicsSceneHoverEnter</a> event when the mouse enters its area. As the mouse continues moving inside the item's area, <a href="qgraphicsscene.html">QGraphicsScene</a> will send it <a href="../qtcore/qevent.html#Type-enum">GraphicsSceneHoverMove</a> events. When the mouse leaves the item's area, the item will receive a <a href="../qtcore/qevent.html#Type-enum">GraphicsSceneHoverLeave</a> event.</p>
<p>All mouse events are delivered to the current <i>mouse grabber</i> item. An item becomes the scene's mouse grabber if it accepts mouse events (see <a href="qgraphicsitem.html#acceptedMouseButtons">QGraphicsItem::acceptedMouseButtons</a>()) and it receives a mouse press. It stays the mouse grabber until it receives a mouse release when no other mouse buttons are pressed. You can call <a href="qgraphicsscene.html#mouseGrabberItem">mouseGrabberItem</a>() to determine what item is currently grabbing the mouse.</p>
</div>
<p><b>See also </b><a href="qgraphicsitem.html">QGraphicsItem</a> and <a href="qgraphicsview.html">QGraphicsView</a>.</p>
<!-- @@@QGraphicsScene -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$ItemIndexMethod$$$BspTreeIndex$$$NoIndex -->
<h3 class="fn" id="ItemIndexMethod-enum"><a name="ItemIndexMethod-enum"></a>enum QGraphicsScene::<span class="name">ItemIndexMethod</span></h3>
<p>This enum describes the indexing algorithms <a href="qgraphicsscene.html">QGraphicsScene</a> provides for managing positional information about items on the scene.</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>QGraphicsScene::BspTreeIndex</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">A Binary Space Partitioning tree is applied. All <a href="qgraphicsscene.html">QGraphicsScene</a>'s item location algorithms are of an order close to logarithmic complexity, by making use of binary search. Adding, moving and removing items is logarithmic. This approach is best for static scenes (i.e&#x2e;, scenes where most items do not move).</td></tr>
<tr><td class="topAlign"><code>QGraphicsScene::NoIndex</code></td><td class="topAlign tblval"><code>-1</code></td><td class="topAlign">No index is applied. Item location is of linear complexity, as all items on the scene are searched. Adding, moving and removing items, however, is done in constant time. This approach is ideal for dynamic scenes, where many items are added, moved or removed continuously.</td></tr>
</table></div>
<p><b>See also </b><a href="qgraphicsscene.html#itemIndexMethod-prop">setItemIndexMethod</a>() and <a href="qgraphicsscene.html#bspTreeDepth-prop">bspTreeDepth</a>.</p>
<!-- @@@ItemIndexMethod -->
<!-- $$$SceneLayer$$$ItemLayer$$$BackgroundLayer$$$ForegroundLayer$$$AllLayers -->
<h3 class="flags" id="SceneLayer-enum"><a name="SceneLayer-enum"></a>enum QGraphicsScene::<span class="name">SceneLayer</span><br/>flags QGraphicsScene::<span class="name">SceneLayers</span></h3>
<p>This enum describes the rendering layers in a <a href="qgraphicsscene.html">QGraphicsScene</a>. When <a href="qgraphicsscene.html">QGraphicsScene</a> draws the scene contents, it renders each of these layers separately, in order.</p>
<p>Each layer represents a flag that can be OR'ed together when calling functions such as <a href="qgraphicsscene.html#invalidate">invalidate</a>() or <a href="qgraphicsview.html#invalidateScene">QGraphicsView::invalidateScene</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>QGraphicsScene::ItemLayer</code></td><td class="topAlign tblval"><code>0x1</code></td><td class="topAlign">The item layer. <a href="qgraphicsscene.html">QGraphicsScene</a> renders all items are in this layer by calling the virtual function drawItems(). The item layer is drawn after the background layer, but before the foreground layer.</td></tr>
<tr><td class="topAlign"><code>QGraphicsScene::BackgroundLayer</code></td><td class="topAlign tblval"><code>0x2</code></td><td class="topAlign">The background layer. <a href="qgraphicsscene.html">QGraphicsScene</a> renders the scene's background in this layer by calling the virtual function <a href="qgraphicsscene.html#drawBackground">drawBackground</a>(). The background layer is drawn first of all layers.</td></tr>
<tr><td class="topAlign"><code>QGraphicsScene::ForegroundLayer</code></td><td class="topAlign tblval"><code>0x4</code></td><td class="topAlign">The foreground layer. <a href="qgraphicsscene.html">QGraphicsScene</a> renders the scene's foreground in this layer by calling the virtual function <a href="qgraphicsscene.html#drawForeground">drawForeground</a>(). The foreground layer is drawn last of all layers.</td></tr>
<tr><td class="topAlign"><code>QGraphicsScene::AllLayers</code></td><td class="topAlign tblval"><code>0xffff</code></td><td class="topAlign">All layers; this value represents a combination of all three layers.</td></tr>
</table></div>
<p>This enum was introduced or modified in  Qt 4.3.</p>
<p>The SceneLayers type is a typedef for <a href="../qtcore/qflags.html">QFlags</a>&lt;SceneLayer&gt;. It stores an OR combination of SceneLayer values.</p>
<p><b>See also </b><a href="qgraphicsscene.html#invalidate">invalidate</a>() and <a href="qgraphicsview.html#invalidateScene">QGraphicsView::invalidateScene</a>().</p>
<!-- @@@SceneLayer -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$backgroundBrush-prop$$$backgroundBrush$$$setBackgroundBrushconstQBrush& -->
<h3 class="fn" id="backgroundBrush-prop"><a name="backgroundBrush-prop"></a><span class="name">backgroundBrush</span> : <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span></h3>
<p>This property holds the background brush of the scene.</p>
<p>Set this property to changes the scene's background to a different color, gradient or texture. The default background brush is <a href="../qtcore/qt.html#BrushStyle-enum">Qt::NoBrush</a>. The background is drawn before (behind) the items.</p>
<p>Example:</p>
<pre class="cpp">

  <span class="type"><a href="qgraphicsscene.html#QGraphicsScene">QGraphicsScene</a></span> scene;
  <span class="type"><a href="qgraphicsview.html">QGraphicsView</a></span> view(<span class="operator">&amp;</span>scene);
  view<span class="operator">.</span>show();

  <span class="comment">// a blue background</span>
  scene<span class="operator">.</span>setBackgroundBrush(<span class="type"><a href="../qtcore/qt.html">Qt</a></span><span class="operator">::</span>blue);

  <span class="comment">// a gradient background</span>
  <span class="type"><a href="../qtgui/qradialgradient.html">QRadialGradient</a></span> gradient(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">10</span>);
  gradient<span class="operator">.</span>setSpread(<span class="type"><a href="../qtgui/qgradient.html">QGradient</a></span><span class="operator">::</span>RepeatSpread);
  scene<span class="operator">.</span>setBackgroundBrush(gradient);

</pre>
<p><a href="qgraphicsscene.html#render">QGraphicsScene::render</a>() calls <a href="qgraphicsscene.html#drawBackground">drawBackground</a>() to draw the scene background. For more detailed control over how the background is drawn, you can reimplement <a href="qgraphicsscene.html#drawBackground">drawBackground</a>() in a subclass of <a href="qgraphicsscene.html">QGraphicsScene</a>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QBrush </td><td class="memItemRight bottomAlign"><span class="name"><b>backgroundBrush</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setBackgroundBrush</b></span>(const QBrush &amp;<i>brush</i>)</td></tr>
</table></div>
<!-- @@@backgroundBrush -->
<!-- $$$bspTreeDepth-prop$$$bspTreeDepth$$$setBspTreeDepthint -->
<h3 class="fn" id="bspTreeDepth-prop"><a name="bspTreeDepth-prop"></a><span class="name">bspTreeDepth</span> : <span class="type">int</span></h3>
<p>This property holds the depth of <a href="qgraphicsscene.html">QGraphicsScene</a>'s BSP index tree</p>
<p>This property has no effect when <a href="qgraphicsscene.html#ItemIndexMethod-enum">NoIndex</a> is used.</p>
<p>This value determines the depth of <a href="qgraphicsscene.html">QGraphicsScene</a>'s BSP tree. The depth directly affects <a href="qgraphicsscene.html">QGraphicsScene</a>'s performance and memory usage; the latter growing exponentially with the depth of the tree. With an optimal tree depth, <a href="qgraphicsscene.html">QGraphicsScene</a> can instantly determine the locality of items, even for scenes with thousands or millions of items. This also greatly improves rendering performance.</p>
<p>By default, the value is 0, in which case Qt will guess a reasonable default depth based on the size, location and number of items in the scene. If these parameters change frequently, however, you may experience slowdowns as <a href="qgraphicsscene.html">QGraphicsScene</a> retunes the depth internally. You can avoid potential slowdowns by fixating the tree depth through setting this property.</p>
<p>The depth of the tree and the size of the scene rectangle decide the granularity of the scene's partitioning. The size of each scene segment is determined by the following algorithm:</p>
<pre class="cpp">

  <span class="type"><a href="../qtcore/qsizef.html">QSizeF</a></span> segmentSize <span class="operator">=</span> sceneRect()<span class="operator">.</span>size() <span class="operator">/</span> pow(<span class="number">2</span><span class="operator">,</span> depth <span class="operator">-</span> <span class="number">1</span>);

</pre>
<p>The BSP tree has an optimal size when each segment contains between 0 and 10 items.</p>
<p>This property was introduced in  Qt 4.3.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>bspTreeDepth</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setBspTreeDepth</b></span>(int <i>depth</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qgraphicsscene.html#itemIndexMethod-prop">itemIndexMethod</a>.</p>
<!-- @@@bspTreeDepth -->
<!-- $$$font-prop$$$font$$$setFontconstQFont& -->
<h3 class="fn" id="font-prop"><a name="font-prop"></a><span class="name">font</span> : <span class="type"><a href="../qtgui/qfont.html">QFont</a></span></h3>
<p>This property holds the scene's default font</p>
<p>This property provides the scene's font. The scene font defaults to, and resolves all its entries from, <a href="qapplication.html#font">QApplication::font</a>.</p>
<p>If the scene's font changes, either directly through setFont() or indirectly when the application font changes, <a href="qgraphicsscene.html">QGraphicsScene</a> first sends itself a <a href="../qtcore/qevent.html#Type-enum">FontChange</a> event, and it then sends <a href="../qtcore/qevent.html#Type-enum">FontChange</a> events to all top-level widget items in the scene. These items respond by resolving their own fonts to the scene, and they then notify their children, who again notify their children, and so on, until all widget items have updated their fonts.</p>
<p>Changing the scene font, (directly or indirectly through <a href="qapplication.html#setFont">QApplication::setFont</a>(),) automatically schedules a redraw the entire scene.</p>
<p>This property was introduced in  Qt 4.4.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QFont </td><td class="memItemRight bottomAlign"><span class="name"><b>font</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFont</b></span>(const QFont &amp;<i>font</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qwidget.html#font-prop">QWidget::font</a>, <a href="qapplication.html#setFont">QApplication::setFont</a>(), <a href="qgraphicsscene.html#palette-prop">palette</a>, and <a href="qgraphicsscene.html#style">style</a>().</p>
<!-- @@@font -->
<!-- $$$foregroundBrush-prop$$$foregroundBrush$$$setForegroundBrushconstQBrush& -->
<h3 class="fn" id="foregroundBrush-prop"><a name="foregroundBrush-prop"></a><span class="name">foregroundBrush</span> : <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span></h3>
<p>This property holds the foreground brush of the scene.</p>
<p>Change this property to set the scene's foreground to a different color, gradient or texture.</p>
<p>The foreground is drawn after (on top of) the items. The default foreground brush is <a href="../qtcore/qt.html#BrushStyle-enum">Qt::NoBrush</a> ( i.e&#x2e; the foreground is not drawn).</p>
<p>Example:</p>
<pre class="cpp">

  <span class="type"><a href="qgraphicsscene.html#QGraphicsScene">QGraphicsScene</a></span> scene;
  <span class="type"><a href="qgraphicsview.html">QGraphicsView</a></span> view(<span class="operator">&amp;</span>scene);
  view<span class="operator">.</span>show();

  <span class="comment">// a white semi-transparent foreground</span>
  scene<span class="operator">.</span>setForegroundBrush(<span class="type"><a href="../qtgui/qcolor.html">QColor</a></span>(<span class="number">255</span><span class="operator">,</span> <span class="number">255</span><span class="operator">,</span> <span class="number">255</span><span class="operator">,</span> <span class="number">127</span>));

  <span class="comment">// a grid foreground</span>
  scene<span class="operator">.</span>setForegroundBrush(<span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span>(<span class="type"><a href="../qtcore/qt.html">Qt</a></span><span class="operator">::</span>lightGray<span class="operator">,</span> <span class="type"><a href="../qtcore/qt.html">Qt</a></span><span class="operator">::</span>CrossPattern));

</pre>
<p><a href="qgraphicsscene.html#render">QGraphicsScene::render</a>() calls <a href="qgraphicsscene.html#drawForeground">drawForeground</a>() to draw the scene foreground. For more detailed control over how the foreground is drawn, you can reimplement the <a href="qgraphicsscene.html#drawForeground">drawForeground</a>() function in a <a href="qgraphicsscene.html">QGraphicsScene</a> subclass.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QBrush </td><td class="memItemRight bottomAlign"><span class="name"><b>foregroundBrush</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setForegroundBrush</b></span>(const QBrush &amp;<i>brush</i>)</td></tr>
</table></div>
<!-- @@@foregroundBrush -->
<!-- $$$itemIndexMethod-prop$$$itemIndexMethod$$$setItemIndexMethodItemIndexMethod -->
<h3 class="fn" id="itemIndexMethod-prop"><a name="itemIndexMethod-prop"></a><span class="name">itemIndexMethod</span> : <span class="type"><a href="qgraphicsscene.html#ItemIndexMethod-enum">ItemIndexMethod</a></span></h3>
<p>This property holds the item indexing method.</p>
<p><a href="qgraphicsscene.html">QGraphicsScene</a> applies an indexing algorithm to the scene, to speed up item discovery functions like <a href="qgraphicsscene.html#items">items</a>() and <a href="qgraphicsscene.html#itemAt">itemAt</a>(). Indexing is most efficient for static scenes (i.e&#x2e;, where items don't move around). For dynamic scenes, or scenes with many animated items, the index bookkeeping can outweight the fast lookup speeds.</p>
<p>For the common case, the default index method <a href="qgraphicsscene.html#ItemIndexMethod-enum">BspTreeIndex</a> works fine. If your scene uses many animations and you are experiencing slowness, you can disable indexing by calling <code>setItemIndexMethod(NoIndex)</code>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> ItemIndexMethod </td><td class="memItemRight bottomAlign"><span class="name"><b>itemIndexMethod</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setItemIndexMethod</b></span>(ItemIndexMethod <i>method</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qgraphicsscene.html#bspTreeDepth-prop">bspTreeDepth</a>.</p>
<!-- @@@itemIndexMethod -->
<!-- $$$minimumRenderSize-prop$$$minimumRenderSize$$$setMinimumRenderSizeqreal -->
<h3 class="fn" id="minimumRenderSize-prop"><a name="minimumRenderSize-prop"></a><span class="name">minimumRenderSize</span> : <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span></h3>
<p>This property holds the minimal view-transformed size an item must have to be drawn</p>
<p>When the scene is rendered, any item whose width or height, transformed to the target view, is smaller that minimumRenderSize(), will not be rendered. If an item is not rendered and it clips its children items they will also not be rendered. Set this value to speed up rendering of scenes with many objects rendered on a zoomed out view.</p>
<p>The default value is 0. If unset, or if set to 0 or a negative value, all items will always be rendered.</p>
<p>For example, setting this property can be especially useful if a scene is rendered by multiple views, one of which serves as an overview which always displays all items. In scenes with many items, such a view will use a high scaling factor so that all items can be shown. Due to the scaling, smaller items will only make an insignificant contribution to the final rendered scene. To avoid drawing these items and reduce the time necessary to render the scene, you can call setMinimumRenderSize() with a non-negative value.</p>
<p><b>Note: </b>Items that are not drawn as a result of being too small, are still returned by methods such as <a href="qgraphicsscene.html#items">items</a>() and <a href="qgraphicsscene.html#itemAt">itemAt</a>(), and participate in collision detection and interactions. It is recommended that you set minimumRenderSize() to a value less than or equal to 1 in order to avoid large unrendered items that are interactive.</p><p>This property was introduced in  Qt 5.4.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b>minimumRenderSize</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setMinimumRenderSize</b></span>(qreal <i>minSize</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qstyleoptiongraphicsitem.html#levelOfDetailFromTransform">QStyleOptionGraphicsItem::levelOfDetailFromTransform</a>().</p>
<!-- @@@minimumRenderSize -->
<!-- $$$palette-prop$$$palette$$$setPaletteconstQPalette& -->
<h3 class="fn" id="palette-prop"><a name="palette-prop"></a><span class="name">palette</span> : <span class="type"><a href="../qtgui/qpalette.html">QPalette</a></span></h3>
<p>This property holds the scene's default palette</p>
<p>This property provides the scene's palette. The scene palette defaults to, and resolves all its entries from, <a href="qapplication.html#palette">QApplication::palette</a>.</p>
<p>If the scene's palette changes, either directly through setPalette() or indirectly when the application palette changes, <a href="qgraphicsscene.html">QGraphicsScene</a> first sends itself a <a href="../qtcore/qevent.html#Type-enum">PaletteChange</a> event, and it then sends <a href="../qtcore/qevent.html#Type-enum">PaletteChange</a> events to all top-level widget items in the scene. These items respond by resolving their own palettes to the scene, and they then notify their children, who again notify their children, and so on, until all widget items have updated their palettes.</p>
<p>Changing the scene palette, (directly or indirectly through <a href="qapplication.html#setPalette">QApplication::setPalette</a>(),) automatically schedules a redraw the entire scene.</p>
<p>This property was introduced in  Qt 4.4.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QPalette </td><td class="memItemRight bottomAlign"><span class="name"><b>palette</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setPalette</b></span>(const QPalette &amp;<i>palette</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qwidget.html#palette-prop">QWidget::palette</a>, <a href="qapplication.html#setPalette">QApplication::setPalette</a>(), <a href="stylesheet-reference.html#font">font</a>, and <a href="qgraphicsscene.html#style">style</a>().</p>
<!-- @@@palette -->
<!-- $$$sceneRect-prop$$$sceneRect$$$setSceneRectconstQRectF&$$$setSceneRectqrealqrealqrealqreal -->
<h3 class="fn" id="sceneRect-prop"><a name="sceneRect-prop"></a><span class="name">sceneRect</span> : <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span></h3>
<p>This property holds the scene rectangle; the bounding rectangle of the scene</p>
<p>The scene rectangle defines the extent of the scene. It is primarily used by <a href="qgraphicsview.html">QGraphicsView</a> to determine the view's default scrollable area, and by <a href="qgraphicsscene.html">QGraphicsScene</a> to manage item indexing.</p>
<p>If unset, or if set to a null <a href="../qtcore/qrectf.html">QRectF</a>, sceneRect() will return the largest bounding rect of all items on the scene since the scene was created (i.e&#x2e;, a rectangle that grows when items are added to or moved in the scene, but never shrinks).</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QRectF </td><td class="memItemRight bottomAlign"><span class="name"><b>sceneRect</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setSceneRect</b></span>(const QRectF &amp;<i>rect</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setSceneRect</b></span>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qgraphicsscene.html#width">width</a>(), <a href="qgraphicsscene.html#height">height</a>(), and <a href="qgraphicsview.html#sceneRect-prop">QGraphicsView::sceneRect</a>.</p>
<!-- @@@sceneRect -->
<!-- $$$stickyFocus-prop$$$stickyFocus$$$setStickyFocusbool -->
<h3 class="fn" id="stickyFocus-prop"><a name="stickyFocus-prop"></a><span class="name">stickyFocus</span> : <span class="type">bool</span></h3>
<p>This property holds whether clicking into the scene background will clear focus</p>
<p>In a <a href="qgraphicsscene.html">QGraphicsScene</a> with stickyFocus set to true, focus will remain unchanged when the user clicks into the scene background or on an item that does not accept focus. Otherwise, focus will be cleared.</p>
<p>By default, this property is <code>false</code>.</p>
<p>Focus changes in response to a mouse press. You can reimplement <a href="qgraphicsscene.html#mousePressEvent">mousePressEvent</a>() in a subclass of <a href="qgraphicsscene.html">QGraphicsScene</a> to toggle this property based on where the user has clicked.</p>
<p>This property was introduced in  Qt 4.6.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>stickyFocus</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setStickyFocus</b></span>(bool <i>enabled</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qgraphicsscene.html#clearFocus">clearFocus</a>() and <a href="qgraphicsscene.html#setFocusItem">setFocusItem</a>().</p>
<!-- @@@stickyFocus -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QGraphicsScene[overload1]$$$QGraphicsSceneQObject* -->
<h3 class="fn" id="QGraphicsScene"><a name="QGraphicsScene"></a>QGraphicsScene::<span class="name">QGraphicsScene</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Constructs a <a href="qgraphicsscene.html">QGraphicsScene</a> object. The <i>parent</i> parameter is passed to <a href="../qtcore/qobject.html">QObject</a>'s constructor.</p>
<!-- @@@QGraphicsScene -->
<!-- $$$QGraphicsScene$$$QGraphicsSceneconstQRectF&QObject* -->
<h3 class="fn" id="QGraphicsScene-1"><a name="QGraphicsScene-1"></a>QGraphicsScene::<span class="name">QGraphicsScene</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>sceneRect</i>, <span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Constructs a <a href="qgraphicsscene.html">QGraphicsScene</a> object, using <i>sceneRect</i> for its scene rectangle. The <i>parent</i> parameter is passed to <a href="../qtcore/qobject.html">QObject</a>'s constructor.</p>
<p><b>See also </b><a href="qgraphicsscene.html#sceneRect-prop">sceneRect</a>.</p>
<!-- @@@QGraphicsScene -->
<!-- $$$QGraphicsScene$$$QGraphicsSceneqrealqrealqrealqrealQObject* -->
<h3 class="fn" id="QGraphicsScene-2"><a name="QGraphicsScene-2"></a>QGraphicsScene::<span class="name">QGraphicsScene</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>, <span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Constructs a <a href="qgraphicsscene.html">QGraphicsScene</a> object, using the rectangle specified by (<i>x</i>, <i>y</i>), and the given <i>width</i> and <i>height</i> for its scene rectangle. The <i>parent</i> parameter is passed to <a href="../qtcore/qobject.html">QObject</a>'s constructor.</p>
<p><b>See also </b><a href="qgraphicsscene.html#sceneRect-prop">sceneRect</a>.</p>
<!-- @@@QGraphicsScene -->
<!-- $$$~QGraphicsScene[overload1]$$$~QGraphicsScene -->
<h3 class="fn" id="dtor.QGraphicsScene"><a name="dtor.QGraphicsScene"></a><code>[virtual] </code>QGraphicsScene::<span class="name">~QGraphicsScene</span>()</h3>
<p>Removes and deletes all items from the scene object before destroying the scene object. The scene object is removed from the application's global scene list, and it is removed from all associated views.</p>
<!-- @@@~QGraphicsScene -->
<!-- $$$activePanel[overload1]$$$activePanel -->
<h3 class="fn" id="activePanel"><a name="activePanel"></a><span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *QGraphicsScene::<span class="name">activePanel</span>() const</h3>
<p>Returns the current active panel, or 0 if no panel is currently active.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsscene.html#setActivePanel">QGraphicsScene::setActivePanel</a>().</p>
<!-- @@@activePanel -->
<!-- $$$activeWindow[overload1]$$$activeWindow -->
<h3 class="fn" id="activeWindow"><a name="activeWindow"></a><span class="type"><a href="qgraphicswidget.html">QGraphicsWidget</a></span> *QGraphicsScene::<span class="name">activeWindow</span>() const</h3>
<p>Returns the current active window, or 0 if no window is currently active.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsscene.html#setActiveWindow">QGraphicsScene::setActiveWindow</a>().</p>
<!-- @@@activeWindow -->
<!-- $$$addEllipse[overload1]$$$addEllipseconstQRectF&constQPen&constQBrush& -->
<h3 class="fn" id="addEllipse"><a name="addEllipse"></a><span class="type"><a href="qgraphicsellipseitem.html">QGraphicsEllipseItem</a></span> *QGraphicsScene::<span class="name">addEllipse</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>, const <span class="type"><a href="../qtgui/qpen.html">QPen</a></span> &amp;<i>pen</i> = QPen(), const <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> &amp;<i>brush</i> = QBrush())</h3>
<p>Creates and adds an ellipse item to the scene, and returns the item pointer. The geometry of the ellipse is defined by <i>rect</i>, and its pen and brush are initialized to <i>pen</i> and <i>brush</i>.</p>
<p>Note that the item's geometry is provided in item coordinates, and its position is initialized to (0, 0).</p>
<p>If the item is visible (i.e&#x2e;, <a href="qgraphicsitem.html#isVisible">QGraphicsItem::isVisible</a>() returns <code>true</code>), <a href="qgraphicsscene.html">QGraphicsScene</a> will emit <a href="qgraphicsscene.html#changed">changed</a>() once control goes back to the event loop.</p>
<p><b>See also </b><a href="qgraphicsscene.html#addLine">addLine</a>(), <a href="qgraphicsscene.html#addPath">addPath</a>(), <a href="qgraphicsscene.html#addPixmap">addPixmap</a>(), <a href="qgraphicsscene.html#addRect">addRect</a>(), <a href="qgraphicsscene.html#addText">addText</a>(), <a href="qgraphicsscene.html#addItem">addItem</a>(), and <a href="qgraphicsscene.html#addWidget">addWidget</a>().</p>
<!-- @@@addEllipse -->
<!-- $$$addEllipse$$$addEllipseqrealqrealqrealqrealconstQPen&constQBrush& -->
<h3 class="fn" id="addEllipse-1"><a name="addEllipse-1"></a><span class="type"><a href="qgraphicsellipseitem.html">QGraphicsEllipseItem</a></span> *QGraphicsScene::<span class="name">addEllipse</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 <span class="type"><a href="../qtgui/qpen.html">QPen</a></span> &amp;<i>pen</i> = QPen(), const <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> &amp;<i>brush</i> = QBrush())</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsscene.html#addEllipse">addEllipse</a>(<a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>), <i>pen</i>, <i>brush</i>).</p>
<p>This function was introduced in  Qt 4.3.</p>
<!-- @@@addEllipse -->
<!-- $$$addItem[overload1]$$$addItemQGraphicsItem* -->
<h3 class="fn" id="addItem"><a name="addItem"></a><span class="type">void</span> QGraphicsScene::<span class="name">addItem</span>(<span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *<i>item</i>)</h3>
<p>Adds or moves the <i>item</i> and all its childen to this scene. This scene takes ownership of the <i>item</i>.</p>
<p>If the item is visible (i.e&#x2e;, <a href="qgraphicsitem.html#isVisible">QGraphicsItem::isVisible</a>() returns true), <a href="qgraphicsscene.html">QGraphicsScene</a> will emit <a href="qgraphicsscene.html#changed">changed</a>() once control goes back to the event loop.</p>
<p>If the item is already in a different scene, it will first be removed from its old scene, and then added to this scene as a top-level.</p>
<p><a href="qgraphicsscene.html">QGraphicsScene</a> will send ItemSceneChange notifications to <i>item</i> while it is added to the scene. If item does not currently belong to a scene, only one notification is sent. If it does belong to scene already (i.e&#x2e;, it is moved to this scene), <a href="qgraphicsscene.html">QGraphicsScene</a> will send an addition notification as the item is removed from its previous scene.</p>
<p>If the item is a panel, the scene is active, and there is no active panel in the scene, then the item will be activated.</p>
<p><b>See also </b><a href="qgraphicsscene.html#removeItem">removeItem</a>(), <a href="qgraphicsscene.html#addEllipse">addEllipse</a>(), <a href="qgraphicsscene.html#addLine">addLine</a>(), <a href="qgraphicsscene.html#addPath">addPath</a>(), <a href="qgraphicsscene.html#addPixmap">addPixmap</a>(), <a href="qgraphicsscene.html#addRect">addRect</a>(), <a href="qgraphicsscene.html#addText">addText</a>(), <a href="qgraphicsscene.html#addWidget">addWidget</a>(), and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p>
<!-- @@@addItem -->
<!-- $$$addLine[overload1]$$$addLineconstQLineF&constQPen& -->
<h3 class="fn" id="addLine"><a name="addLine"></a><span class="type"><a href="qgraphicslineitem.html">QGraphicsLineItem</a></span> *QGraphicsScene::<span class="name">addLine</span>(const <span class="type"><a href="../qtcore/qlinef.html">QLineF</a></span> &amp;<i>line</i>, const <span class="type"><a href="../qtgui/qpen.html">QPen</a></span> &amp;<i>pen</i> = QPen())</h3>
<p>Creates and adds a line item to the scene, and returns the item pointer. The geometry of the line is defined by <i>line</i>, and its pen is initialized to <i>pen</i>.</p>
<p>Note that the item's geometry is provided in item coordinates, and its position is initialized to (0, 0).</p>
<p>If the item is visible (i.e&#x2e;, <a href="qgraphicsitem.html#isVisible">QGraphicsItem::isVisible</a>() returns <code>true</code>), <a href="qgraphicsscene.html">QGraphicsScene</a> will emit <a href="qgraphicsscene.html#changed">changed</a>() once control goes back to the event loop.</p>
<p><b>See also </b><a href="qgraphicsscene.html#addEllipse">addEllipse</a>(), <a href="qgraphicsscene.html#addPath">addPath</a>(), <a href="qgraphicsscene.html#addPixmap">addPixmap</a>(), <a href="qgraphicsscene.html#addRect">addRect</a>(), <a href="qgraphicsscene.html#addText">addText</a>(), <a href="qgraphicsscene.html#addItem">addItem</a>(), and <a href="qgraphicsscene.html#addWidget">addWidget</a>().</p>
<!-- @@@addLine -->
<!-- $$$addLine$$$addLineqrealqrealqrealqrealconstQPen& -->
<h3 class="fn" id="addLine-1"><a name="addLine-1"></a><span class="type"><a href="qgraphicslineitem.html">QGraphicsLineItem</a></span> *QGraphicsScene::<span class="name">addLine</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x1</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y1</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x2</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y2</i>, const <span class="type"><a href="../qtgui/qpen.html">QPen</a></span> &amp;<i>pen</i> = QPen())</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsscene.html#addLine">addLine</a>(<a href="../qtcore/qlinef.html">QLineF</a>(<i>x1</i>, <i>y1</i>, <i>x2</i>, <i>y2</i>), <i>pen</i>).</p>
<p>This function was introduced in  Qt 4.3.</p>
<!-- @@@addLine -->
<!-- $$$addPath[overload1]$$$addPathconstQPainterPath&constQPen&constQBrush& -->
<h3 class="fn" id="addPath"><a name="addPath"></a><span class="type"><a href="qgraphicspathitem.html">QGraphicsPathItem</a></span> *QGraphicsScene::<span class="name">addPath</span>(const <span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> &amp;<i>path</i>, const <span class="type"><a href="../qtgui/qpen.html">QPen</a></span> &amp;<i>pen</i> = QPen(), const <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> &amp;<i>brush</i> = QBrush())</h3>
<p>Creates and adds a path item to the scene, and returns the item pointer. The geometry of the path is defined by <i>path</i>, and its pen and brush are initialized to <i>pen</i> and <i>brush</i>.</p>
<p>Note that the item's geometry is provided in item coordinates, and its position is initialized to (0, 0).</p>
<p>If the item is visible (i.e&#x2e;, <a href="qgraphicsitem.html#isVisible">QGraphicsItem::isVisible</a>() returns <code>true</code>), <a href="qgraphicsscene.html">QGraphicsScene</a> will emit <a href="qgraphicsscene.html#changed">changed</a>() once control goes back to the event loop.</p>
<p><b>See also </b><a href="qgraphicsscene.html#addEllipse">addEllipse</a>(), <a href="qgraphicsscene.html#addLine">addLine</a>(), <a href="qgraphicsscene.html#addPixmap">addPixmap</a>(), <a href="qgraphicsscene.html#addRect">addRect</a>(), <a href="qgraphicsscene.html#addText">addText</a>(), <a href="qgraphicsscene.html#addItem">addItem</a>(), and <a href="qgraphicsscene.html#addWidget">addWidget</a>().</p>
<!-- @@@addPath -->
<!-- $$$addPixmap[overload1]$$$addPixmapconstQPixmap& -->
<h3 class="fn" id="addPixmap"><a name="addPixmap"></a><span class="type"><a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a></span> *QGraphicsScene::<span class="name">addPixmap</span>(const <span class="type"><a href="../qtgui/qpixmap.html">QPixmap</a></span> &amp;<i>pixmap</i>)</h3>
<p>Creates and adds a pixmap item to the scene, and returns the item pointer. The pixmap is defined by <i>pixmap</i>.</p>
<p>Note that the item's geometry is provided in item coordinates, and its position is initialized to (0, 0).</p>
<p>If the item is visible (i.e&#x2e;, <a href="qgraphicsitem.html#isVisible">QGraphicsItem::isVisible</a>() returns <code>true</code>), <a href="qgraphicsscene.html">QGraphicsScene</a> will emit <a href="qgraphicsscene.html#changed">changed</a>() once control goes back to the event loop.</p>
<p><b>See also </b><a href="qgraphicsscene.html#addEllipse">addEllipse</a>(), <a href="qgraphicsscene.html#addLine">addLine</a>(), <a href="qgraphicsscene.html#addPath">addPath</a>(), <a href="qgraphicsscene.html#addRect">addRect</a>(), <a href="qgraphicsscene.html#addText">addText</a>(), <a href="qgraphicsscene.html#addItem">addItem</a>(), and <a href="qgraphicsscene.html#addWidget">addWidget</a>().</p>
<!-- @@@addPixmap -->
<!-- $$$addPolygon[overload1]$$$addPolygonconstQPolygonF&constQPen&constQBrush& -->
<h3 class="fn" id="addPolygon"><a name="addPolygon"></a><span class="type"><a href="qgraphicspolygonitem.html">QGraphicsPolygonItem</a></span> *QGraphicsScene::<span class="name">addPolygon</span>(const <span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> &amp;<i>polygon</i>, const <span class="type"><a href="../qtgui/qpen.html">QPen</a></span> &amp;<i>pen</i> = QPen(), const <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> &amp;<i>brush</i> = QBrush())</h3>
<p>Creates and adds a polygon item to the scene, and returns the item pointer. The polygon is defined by <i>polygon</i>, and its pen and brush are initialized to <i>pen</i> and <i>brush</i>.</p>
<p>Note that the item's geometry is provided in item coordinates, and its position is initialized to (0, 0).</p>
<p>If the item is visible (i.e&#x2e;, <a href="qgraphicsitem.html#isVisible">QGraphicsItem::isVisible</a>() returns <code>true</code>), <a href="qgraphicsscene.html">QGraphicsScene</a> will emit <a href="qgraphicsscene.html#changed">changed</a>() once control goes back to the event loop.</p>
<p><b>See also </b><a href="qgraphicsscene.html#addEllipse">addEllipse</a>(), <a href="qgraphicsscene.html#addLine">addLine</a>(), <a href="qgraphicsscene.html#addPath">addPath</a>(), <a href="qgraphicsscene.html#addRect">addRect</a>(), <a href="qgraphicsscene.html#addText">addText</a>(), <a href="qgraphicsscene.html#addItem">addItem</a>(), and <a href="qgraphicsscene.html#addWidget">addWidget</a>().</p>
<!-- @@@addPolygon -->
<!-- $$$addRect[overload1]$$$addRectconstQRectF&constQPen&constQBrush& -->
<h3 class="fn" id="addRect"><a name="addRect"></a><span class="type"><a href="qgraphicsrectitem.html">QGraphicsRectItem</a></span> *QGraphicsScene::<span class="name">addRect</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>, const <span class="type"><a href="../qtgui/qpen.html">QPen</a></span> &amp;<i>pen</i> = QPen(), const <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> &amp;<i>brush</i> = QBrush())</h3>
<p>Creates and adds a rectangle item to the scene, and returns the item pointer. The geometry of the rectangle is defined by <i>rect</i>, and its pen and brush are initialized to <i>pen</i> and <i>brush</i>.</p>
<p>Note that the item's geometry is provided in item coordinates, and its position is initialized to (0, 0). For example, if a <a href="../qtcore/qrect.html">QRect</a>(50, 50, 100, 100) is added, its top-left corner will be at (50, 50) relative to the origin in the items coordinate system.</p>
<p>If the item is visible (i.e&#x2e;, <a href="qgraphicsitem.html#isVisible">QGraphicsItem::isVisible</a>() returns <code>true</code>), <a href="qgraphicsscene.html">QGraphicsScene</a> will emit <a href="qgraphicsscene.html#changed">changed</a>() once control goes back to the event loop.</p>
<p><b>See also </b><a href="qgraphicsscene.html#addEllipse">addEllipse</a>(), <a href="qgraphicsscene.html#addLine">addLine</a>(), <a href="qgraphicsscene.html#addPixmap">addPixmap</a>(), <a href="qgraphicsscene.html#addPixmap">addPixmap</a>(), <a href="qgraphicsscene.html#addText">addText</a>(), <a href="qgraphicsscene.html#addItem">addItem</a>(), and <a href="qgraphicsscene.html#addWidget">addWidget</a>().</p>
<!-- @@@addRect -->
<!-- $$$addRect$$$addRectqrealqrealqrealqrealconstQPen&constQBrush& -->
<h3 class="fn" id="addRect-1"><a name="addRect-1"></a><span class="type"><a href="qgraphicsrectitem.html">QGraphicsRectItem</a></span> *QGraphicsScene::<span class="name">addRect</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 <span class="type"><a href="../qtgui/qpen.html">QPen</a></span> &amp;<i>pen</i> = QPen(), const <span class="type"><a href="../qtgui/qbrush.html">QBrush</a></span> &amp;<i>brush</i> = QBrush())</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsscene.html#addRect">addRect</a>(<a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>), <i>pen</i>, <i>brush</i>).</p>
<p>This function was introduced in  Qt 4.3.</p>
<!-- @@@addRect -->
<!-- $$$addSimpleText[overload1]$$$addSimpleTextconstQString&constQFont& -->
<h3 class="fn" id="addSimpleText"><a name="addSimpleText"></a><span class="type"><a href="qgraphicssimpletextitem.html">QGraphicsSimpleTextItem</a></span> *QGraphicsScene::<span class="name">addSimpleText</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>, const <span class="type"><a href="../qtgui/qfont.html">QFont</a></span> &amp;<i>font</i> = QFont())</h3>
<p>Creates and adds a <a href="qgraphicssimpletextitem.html">QGraphicsSimpleTextItem</a> to the scene, and returns the item pointer. The text string is initialized to <i>text</i>, and its font is initialized to <i>font</i>.</p>
<p>The item's position is initialized to (0, 0).</p>
<p>If the item is visible (i.e&#x2e;, <a href="qgraphicsitem.html#isVisible">QGraphicsItem::isVisible</a>() returns <code>true</code>), <a href="qgraphicsscene.html">QGraphicsScene</a> will emit <a href="qgraphicsscene.html#changed">changed</a>() once control goes back to the event loop.</p>
<p><b>See also </b><a href="qgraphicsscene.html#addEllipse">addEllipse</a>(), <a href="qgraphicsscene.html#addLine">addLine</a>(), <a href="qgraphicsscene.html#addPixmap">addPixmap</a>(), <a href="qgraphicsscene.html#addPixmap">addPixmap</a>(), <a href="qgraphicsscene.html#addRect">addRect</a>(), <a href="qgraphicsscene.html#addItem">addItem</a>(), and <a href="qgraphicsscene.html#addWidget">addWidget</a>().</p>
<!-- @@@addSimpleText -->
<!-- $$$addText[overload1]$$$addTextconstQString&constQFont& -->
<h3 class="fn" id="addText"><a name="addText"></a><span class="type"><a href="qgraphicstextitem.html">QGraphicsTextItem</a></span> *QGraphicsScene::<span class="name">addText</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>text</i>, const <span class="type"><a href="../qtgui/qfont.html">QFont</a></span> &amp;<i>font</i> = QFont())</h3>
<p>Creates and adds a text item to the scene, and returns the item pointer. The text string is initialized to <i>text</i>, and its font is initialized to <i>font</i>.</p>
<p>The item's position is initialized to (0, 0).</p>
<p>If the item is visible (i.e&#x2e;, <a href="qgraphicsitem.html#isVisible">QGraphicsItem::isVisible</a>() returns <code>true</code>), <a href="qgraphicsscene.html">QGraphicsScene</a> will emit <a href="qgraphicsscene.html#changed">changed</a>() once control goes back to the event loop.</p>
<p><b>See also </b><a href="qgraphicsscene.html#addEllipse">addEllipse</a>(), <a href="qgraphicsscene.html#addLine">addLine</a>(), <a href="qgraphicsscene.html#addPixmap">addPixmap</a>(), <a href="qgraphicsscene.html#addPixmap">addPixmap</a>(), <a href="qgraphicsscene.html#addRect">addRect</a>(), <a href="qgraphicsscene.html#addItem">addItem</a>(), and <a href="qgraphicsscene.html#addWidget">addWidget</a>().</p>
<!-- @@@addText -->
<!-- $$$addWidget[overload1]$$$addWidgetQWidget*Qt::WindowFlags -->
<h3 class="fn" id="addWidget"><a name="addWidget"></a><span class="type"><a href="qgraphicsproxywidget.html">QGraphicsProxyWidget</a></span> *QGraphicsScene::<span class="name">addWidget</span>(<span class="type"><a href="qwidget.html">QWidget</a></span> *<i>widget</i>, <span class="type"><a href="../qtcore/qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>wFlags</i> = Qt::WindowFlags())</h3>
<p>Creates a new <a href="qgraphicsproxywidget.html">QGraphicsProxyWidget</a> for <i>widget</i>, adds it to the scene, and returns a pointer to the proxy. <i>wFlags</i> set the default window flags for the embedding proxy widget.</p>
<p>The item's position is initialized to (0, 0).</p>
<p>If the item is visible (i.e&#x2e;, <a href="qgraphicsitem.html#isVisible">QGraphicsItem::isVisible</a>() returns <code>true</code>), <a href="qgraphicsscene.html">QGraphicsScene</a> will emit <a href="qgraphicsscene.html#changed">changed</a>() once control goes back to the event loop.</p>
<p>Note that widgets with the <a href="../qtcore/qt.html#WidgetAttribute-enum">Qt::WA_PaintOnScreen</a> widget attribute set and widgets that wrap an external application or controller are not supported. Examples are QGLWidget and QAxWidget.</p>
<p><b>See also </b><a href="qgraphicsscene.html#addEllipse">addEllipse</a>(), <a href="qgraphicsscene.html#addLine">addLine</a>(), <a href="qgraphicsscene.html#addPixmap">addPixmap</a>(), <a href="qgraphicsscene.html#addPixmap">addPixmap</a>(), <a href="qgraphicsscene.html#addRect">addRect</a>(), <a href="qgraphicsscene.html#addText">addText</a>(), <a href="qgraphicsscene.html#addSimpleText">addSimpleText</a>(), and <a href="qgraphicsscene.html#addItem">addItem</a>().</p>
<!-- @@@addWidget -->
<!-- $$$advance[overload1]$$$advance -->
<h3 class="fn" id="advance"><a name="advance"></a><code>[slot] </code><span class="type">void</span> QGraphicsScene::<span class="name">advance</span>()</h3>
<p>This slot <i>advances</i> the scene by one step, by calling <a href="qgraphicsitem.html#advance">QGraphicsItem::advance</a>() for all items on the scene. This is done in two phases: in the first phase, all items are notified that the scene is about to change, and in the second phase all items are notified that they can move. In the first phase, <a href="qgraphicsitem.html#advance">QGraphicsItem::advance</a>() is called passing a value of 0 as an argument, and 1 is passed in the second phase.</p>
<p>Note that you can also use the <a href="../qtcore/animation-overview.html">Animation Framework</a> for animations.</p>
<p><b>See also </b><a href="qgraphicsitem.html#advance">QGraphicsItem::advance</a>() and <a href="../qtcore/qtimeline.html">QTimeLine</a>.</p>
<!-- @@@advance -->
<!-- $$$changed[overload1]$$$changedconstQList<QRectF>& -->
<h3 class="fn" id="changed"><a name="changed"></a><code>[signal] </code><span class="type">void</span> QGraphicsScene::<span class="name">changed</span>(const <span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span>&gt; &amp;<i>region</i>)</h3>
<p>This signal is emitted by <a href="qgraphicsscene.html">QGraphicsScene</a> when control reaches the event loop, if the scene content changes. The <i>region</i> parameter contains a list of scene rectangles that indicate the area that has been changed.</p>
<p><b>See also </b><a href="qgraphicsview.html#updateScene">QGraphicsView::updateScene</a>().</p>
<!-- @@@changed -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn" id="clear"><a name="clear"></a><code>[slot] </code><span class="type">void</span> QGraphicsScene::<span class="name">clear</span>()</h3>
<p>Removes and deletes all items from the scene, but otherwise leaves the state of the scene unchanged.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsscene.html#addItem">addItem</a>().</p>
<!-- @@@clear -->
<!-- $$$clearFocus[overload1]$$$clearFocus -->
<h3 class="fn" id="clearFocus"><a name="clearFocus"></a><span class="type">void</span> QGraphicsScene::<span class="name">clearFocus</span>()</h3>
<p>Clears focus from the scene. If any item has focus when this function is called, it will lose focus, and regain focus again once the scene regains focus.</p>
<p>A scene that does not have focus ignores key events.</p>
<p><b>See also </b><a href="qgraphicsscene.html#hasFocus">hasFocus</a>(), <a href="qgraphicsscene.html#setFocus">setFocus</a>(), and <a href="qgraphicsscene.html#setFocusItem">setFocusItem</a>().</p>
<!-- @@@clearFocus -->
<!-- $$$clearSelection[overload1]$$$clearSelection -->
<h3 class="fn" id="clearSelection"><a name="clearSelection"></a><code>[slot] </code><span class="type">void</span> QGraphicsScene::<span class="name">clearSelection</span>()</h3>
<p>Clears the current selection.</p>
<p><b>See also </b><a href="qgraphicsscene.html#setSelectionArea">setSelectionArea</a>() and <a href="qgraphicsscene.html#selectedItems">selectedItems</a>().</p>
<!-- @@@clearSelection -->
<!-- $$$collidingItems[overload1]$$$collidingItemsconstQGraphicsItem*Qt::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</a></span> *&gt; QGraphicsScene::<span class="name">collidingItems</span>(const <span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *<i>item</i>, <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 <i>item</i>. Collisions are determined by calling <a href="qgraphicsitem.html#collidesWithItem">QGraphicsItem::collidesWithItem</a>(); the collision detection is determined by <i>mode</i>. By default, all items whose shape intersects <i>item</i> or is contained inside <i>item</i>'s shape are returned.</p>
<p>The items are returned in descending stacking order (i.e&#x2e;, the first item in the list is the uppermost item, and the last item is the lowermost item).</p>
<p><b>See also </b><a href="qgraphicsscene.html#items">items</a>(), <a href="qgraphicsscene.html#itemAt">itemAt</a>(), <a href="qgraphicsitem.html#collidesWithItem">QGraphicsItem::collidesWithItem</a>(), and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p>
<!-- @@@collidingItems -->
<!-- $$$contextMenuEvent[overload1]$$$contextMenuEventQGraphicsSceneContextMenuEvent* -->
<h3 class="fn" id="contextMenuEvent"><a name="contextMenuEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsScene::<span class="name">contextMenuEvent</span>(<span class="type"><a href="qgraphicsscenecontextmenuevent.html">QGraphicsSceneContextMenuEvent</a></span> *<i>contextMenuEvent</i>)</h3>
<p>This event handler, for event <i>contextMenuEvent</i>, can be reimplemented in a subclass to receive context menu events. The default implementation forwards the event to the topmost visible item that accepts context menu events at the position of the event. If no items accept context menu events at this position, the event is ignored.</p>
<p>Note: See <a href="qgraphicsscene.html#items">items</a>() for a definition of which items are considered visible by this function.</p>
<p><b>See also </b><a href="qgraphicsitem.html#contextMenuEvent">QGraphicsItem::contextMenuEvent</a>().</p>
<!-- @@@contextMenuEvent -->
<!-- $$$createItemGroup[overload1]$$$createItemGroupconstQList<QGraphicsItem*>& -->
<h3 class="fn" id="createItemGroup"><a name="createItemGroup"></a><span class="type"><a href="qgraphicsitemgroup.html">QGraphicsItemGroup</a></span> *QGraphicsScene::<span class="name">createItemGroup</span>(const <span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *&gt; &amp;<i>items</i>)</h3>
<p>Groups all items in <i>items</i> into a new <a href="qgraphicsitemgroup.html">QGraphicsItemGroup</a>, and returns a pointer to the group. The group is created with the common ancestor of <i>items</i> as its parent, and with position (0, 0). The items are all reparented to the group, and their positions and transformations are mapped to the group. If <i>items</i> is empty, this function will return an empty top-level <a href="qgraphicsitemgroup.html">QGraphicsItemGroup</a>.</p>
<p><a href="qgraphicsscene.html">QGraphicsScene</a> has ownership of the group item; you do not need to delete it. To dismantle (ungroup) a group, call <a href="qgraphicsscene.html#destroyItemGroup">destroyItemGroup</a>().</p>
<p><b>See also </b><a href="qgraphicsscene.html#destroyItemGroup">destroyItemGroup</a>() and <a href="qgraphicsitemgroup.html#addToGroup">QGraphicsItemGroup::addToGroup</a>().</p>
<!-- @@@createItemGroup -->
<!-- $$$destroyItemGroup[overload1]$$$destroyItemGroupQGraphicsItemGroup* -->
<h3 class="fn" id="destroyItemGroup"><a name="destroyItemGroup"></a><span class="type">void</span> QGraphicsScene::<span class="name">destroyItemGroup</span>(<span class="type"><a href="qgraphicsitemgroup.html">QGraphicsItemGroup</a></span> *<i>group</i>)</h3>
<p>Reparents all items in <i>group</i> to <i>group</i>'s parent item, then removes <i>group</i> from the scene, and finally deletes it. The items' positions and transformations are mapped from the group to the group's parent.</p>
<p><b>See also </b><a href="qgraphicsscene.html#createItemGroup">createItemGroup</a>() and <a href="qgraphicsitemgroup.html#removeFromGroup">QGraphicsItemGroup::removeFromGroup</a>().</p>
<!-- @@@destroyItemGroup -->
<!-- $$$dragEnterEvent[overload1]$$$dragEnterEventQGraphicsSceneDragDropEvent* -->
<h3 class="fn" id="dragEnterEvent"><a name="dragEnterEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsScene::<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 in a subclass to receive drag enter events for the scene.</p>
<p>The default implementation accepts the event and prepares the scene to accept drag move events.</p>
<p><b>See also </b><a href="qgraphicsitem.html#dragEnterEvent">QGraphicsItem::dragEnterEvent</a>(), <a href="qgraphicsscene.html#dragMoveEvent">dragMoveEvent</a>(), <a href="qgraphicsscene.html#dragLeaveEvent">dragLeaveEvent</a>(), and <a href="qgraphicsscene.html#dropEvent">dropEvent</a>().</p>
<!-- @@@dragEnterEvent -->
<!-- $$$dragLeaveEvent[overload1]$$$dragLeaveEventQGraphicsSceneDragDropEvent* -->
<h3 class="fn" id="dragLeaveEvent"><a name="dragLeaveEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsScene::<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 in a subclass to receive drag leave events for the scene.</p>
<p><b>See also </b><a href="qgraphicsitem.html#dragLeaveEvent">QGraphicsItem::dragLeaveEvent</a>(), <a href="qgraphicsscene.html#dragEnterEvent">dragEnterEvent</a>(), <a href="qgraphicsscene.html#dragMoveEvent">dragMoveEvent</a>(), and <a href="qgraphicsscene.html#dropEvent">dropEvent</a>().</p>
<!-- @@@dragLeaveEvent -->
<!-- $$$dragMoveEvent[overload1]$$$dragMoveEventQGraphicsSceneDragDropEvent* -->
<h3 class="fn" id="dragMoveEvent"><a name="dragMoveEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsScene::<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 in a subclass to receive drag move events for the scene.</p>
<p>Note: See <a href="qgraphicsscene.html#items">items</a>() for a definition of which items are considered visible by this function.</p>
<p><b>See also </b><a href="qgraphicsitem.html#dragMoveEvent">QGraphicsItem::dragMoveEvent</a>(), <a href="qgraphicsscene.html#dragEnterEvent">dragEnterEvent</a>(), <a href="qgraphicsscene.html#dragLeaveEvent">dragLeaveEvent</a>(), and <a href="qgraphicsscene.html#dropEvent">dropEvent</a>().</p>
<!-- @@@dragMoveEvent -->
<!-- $$$drawBackground[overload1]$$$drawBackgroundQPainter*constQRectF& -->
<h3 class="fn" id="drawBackground"><a name="drawBackground"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsScene::<span class="name">drawBackground</span>(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> *<i>painter</i>, const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>)</h3>
<p>Draws the background of the scene using <i>painter</i>, before any items and the foreground are drawn. Reimplement this function to provide a custom background for the scene.</p>
<p>All painting is done in <i>scene</i> coordinates. The <i>rect</i> parameter is the exposed rectangle.</p>
<p>If all you want is to define a color, texture, or gradient for the background, you can call <a href="qgraphicsscene.html#backgroundBrush-prop">setBackgroundBrush</a>() instead.</p>
<p><b>See also </b><a href="qgraphicsscene.html#drawForeground">drawForeground</a>() and <a href="qgraphicsscene-obsolete.html#drawItems">drawItems</a>().</p>
<!-- @@@drawBackground -->
<!-- $$$drawForeground[overload1]$$$drawForegroundQPainter*constQRectF& -->
<h3 class="fn" id="drawForeground"><a name="drawForeground"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsScene::<span class="name">drawForeground</span>(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> *<i>painter</i>, const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>)</h3>
<p>Draws the foreground of the scene using <i>painter</i>, after the background and all items have been drawn. Reimplement this function to provide a custom foreground for the scene.</p>
<p>All painting is done in <i>scene</i> coordinates. The <i>rect</i> parameter is the exposed rectangle.</p>
<p>If all you want is to define a color, texture or gradient for the foreground, you can call <a href="qgraphicsscene.html#foregroundBrush-prop">setForegroundBrush</a>() instead.</p>
<p><b>See also </b><a href="qgraphicsscene.html#drawBackground">drawBackground</a>() and <a href="qgraphicsscene-obsolete.html#drawItems">drawItems</a>().</p>
<!-- @@@drawForeground -->
<!-- $$$dropEvent[overload1]$$$dropEventQGraphicsSceneDragDropEvent* -->
<h3 class="fn" id="dropEvent"><a name="dropEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsScene::<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 in a subclass to receive drop events for the scene.</p>
<p><b>See also </b><a href="qgraphicsitem.html#dropEvent">QGraphicsItem::dropEvent</a>(), <a href="qgraphicsscene.html#dragEnterEvent">dragEnterEvent</a>(), <a href="qgraphicsscene.html#dragMoveEvent">dragMoveEvent</a>(), and <a href="qgraphicsscene.html#dragLeaveEvent">dragLeaveEvent</a>().</p>
<!-- @@@dropEvent -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn" id="event"><a name="event"></a><code>[virtual protected] </code><span class="type">bool</span> QGraphicsScene::<span class="name">event</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="../qtcore/qobject.html#event">QObject::event</a>().</p>
<p>Processes the event <i>event</i>, and dispatches it to the respective event handlers.</p>
<p>In addition to calling the convenience event handlers, this function is responsible for converting mouse move events to hover events for when there is no mouse grabber item. Hover events are delivered directly to items; there is no convenience function for them.</p>
<p>Unlike <a href="qwidget.html">QWidget</a>, <a href="qgraphicsscene.html">QGraphicsScene</a> does not have the convenience functions <a href="qwidget.html#enterEvent">enterEvent()</a> and <a href="qwidget.html#leaveEvent">leaveEvent()</a>. Use this function to obtain those events instead.</p>
<p><b>See also </b><a href="qgraphicsscene.html#contextMenuEvent">contextMenuEvent</a>(), <a href="qgraphicsscene.html#keyPressEvent">keyPressEvent</a>(), <a href="qgraphicsscene.html#keyReleaseEvent">keyReleaseEvent</a>(), <a href="qgraphicsscene.html#mousePressEvent">mousePressEvent</a>(), <a href="qgraphicsscene.html#mouseMoveEvent">mouseMoveEvent</a>(), <a href="qgraphicsscene.html#mouseReleaseEvent">mouseReleaseEvent</a>(), <a href="qgraphicsscene.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a>(), <a href="qgraphicsscene.html#focusInEvent">focusInEvent</a>(), and <a href="qgraphicsscene.html#focusOutEvent">focusOutEvent</a>().</p>
<!-- @@@event -->
<!-- $$$eventFilter[overload1]$$$eventFilterQObject*QEvent* -->
<h3 class="fn" id="eventFilter"><a name="eventFilter"></a><code>[virtual protected] </code><span class="type">bool</span> QGraphicsScene::<span class="name">eventFilter</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>watched</i>, <span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="../qtcore/qobject.html#eventFilter">QObject::eventFilter</a>().</p>
<p><a href="qgraphicsscene.html">QGraphicsScene</a> filters <a href="qapplication.html">QApplication</a>'s events to detect palette and font changes.</p>
<!-- @@@eventFilter -->
<!-- $$$focusInEvent[overload1]$$$focusInEventQFocusEvent* -->
<h3 class="fn" id="focusInEvent"><a name="focusInEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsScene::<span class="name">focusInEvent</span>(<span class="type"><a href="../qtgui/qfocusevent.html">QFocusEvent</a></span> *<i>focusEvent</i>)</h3>
<p>This event handler, for event <i>focusEvent</i>, can be reimplemented in a subclass to receive focus in events.</p>
<p>The default implementation sets focus on the scene, and then on the last focus item.</p>
<p><b>See also </b><a href="qgraphicsitem.html#focusOutEvent">QGraphicsItem::focusOutEvent</a>().</p>
<!-- @@@focusInEvent -->
<!-- $$$focusItem[overload1]$$$focusItem -->
<h3 class="fn" id="focusItem"><a name="focusItem"></a><span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *QGraphicsScene::<span class="name">focusItem</span>() const</h3>
<p>When the scene is active, this functions returns the scene's current focus item, or 0 if no item currently has focus. When the scene is inactive, this functions returns the item that will gain input focus when the scene becomes active.</p>
<p>The focus item receives keyboard input when the scene receives a key event.</p>
<p><b>See also </b><a href="qgraphicsscene.html#setFocusItem">setFocusItem</a>(), <a href="qgraphicsitem.html#hasFocus">QGraphicsItem::hasFocus</a>(), and <a href="qgraphicsscene.html#isActive">isActive</a>().</p>
<!-- @@@focusItem -->
<!-- $$$focusItemChanged[overload1]$$$focusItemChangedQGraphicsItem*QGraphicsItem*Qt::FocusReason -->
<h3 class="fn" id="focusItemChanged"><a name="focusItemChanged"></a><code>[signal] </code><span class="type">void</span> QGraphicsScene::<span class="name">focusItemChanged</span>(<span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *<i>newFocusItem</i>, <span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *<i>oldFocusItem</i>, <span class="type"><a href="../qtcore/qt.html#FocusReason-enum">Qt::FocusReason</a></span> <i>reason</i>)</h3>
<p>This signal is emitted by <a href="qgraphicsscene.html">QGraphicsScene</a> whenever focus changes in the scene (i.e&#x2e;, when an item gains or loses input focus, or when focus passes from one item to another). You can connect to this signal if you need to keep track of when other items gain input focus. It is particularly useful for implementing virtual keyboards, input methods, and cursor items.</p>
<p><i>oldFocusItem</i> is a pointer to the item that previously had focus, or 0 if no item had focus before the signal was emitted. <i>newFocusItem</i> is a pointer to the item that gained input focus, or 0 if focus was lost. <i>reason</i> is the reason for the focus change (e.g&#x2e;, if the scene was deactivated while an input field had focus, <i>oldFocusItem</i> would point to the input field item, <i>newFocusItem</i> would be 0, and <i>reason</i> would be <a href="../qtcore/qt.html#FocusReason-enum">Qt::ActiveWindowFocusReason</a>.</p>
<!-- @@@focusItemChanged -->
<!-- $$$focusNextPrevChild[overload1]$$$focusNextPrevChildbool -->
<h3 class="fn" id="focusNextPrevChild"><a name="focusNextPrevChild"></a><code>[virtual protected slot] </code><span class="type">bool</span> QGraphicsScene::<span class="name">focusNextPrevChild</span>(<span class="type">bool</span> <i>next</i>)</h3>
<p>Finds a new widget to give the keyboard focus to, as appropriate for Tab and Shift+Tab, and returns <code>true</code> if it can find a new widget, or false if it cannot. If <i>next</i> is true, this function searches forward; if <i>next</i> is false, it searches backward.</p>
<p>You can reimplement this function in a subclass of <a href="qgraphicsscene.html">QGraphicsScene</a> to provide fine-grained control over how tab focus passes inside your scene. The default implementation is based on the tab focus chain defined by <a href="qgraphicswidget.html#setTabOrder">QGraphicsWidget::setTabOrder</a>().</p>
<p>This function was introduced in  Qt 4.4.</p>
<!-- @@@focusNextPrevChild -->
<!-- $$$focusOutEvent[overload1]$$$focusOutEventQFocusEvent* -->
<h3 class="fn" id="focusOutEvent"><a name="focusOutEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsScene::<span class="name">focusOutEvent</span>(<span class="type"><a href="../qtgui/qfocusevent.html">QFocusEvent</a></span> *<i>focusEvent</i>)</h3>
<p>This event handler, for event <i>focusEvent</i>, can be reimplemented in a subclass to receive focus out events.</p>
<p>The default implementation removes focus from any focus item, then removes focus from the scene.</p>
<p><b>See also </b><a href="qgraphicsitem.html#focusInEvent">QGraphicsItem::focusInEvent</a>().</p>
<!-- @@@focusOutEvent -->
<!-- $$$hasFocus[overload1]$$$hasFocus -->
<h3 class="fn" id="hasFocus"><a name="hasFocus"></a><span class="type">bool</span> QGraphicsScene::<span class="name">hasFocus</span>() const</h3>
<p>Returns <code>true</code> if the scene has focus; otherwise returns <code>false</code>. If the scene has focus, it will will forward key events from <a href="../qtgui/qkeyevent.html">QKeyEvent</a> to any item that has focus.</p>
<p><b>See also </b><a href="qgraphicsscene.html#setFocus">setFocus</a>() and <a href="qgraphicsscene.html#setFocusItem">setFocusItem</a>().</p>
<!-- @@@hasFocus -->
<!-- $$$height[overload1]$$$height -->
<h3 class="fn" id="height"><a name="height"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QGraphicsScene::<span class="name">height</span>() const</h3>
<p>This convenience function is equivalent to calling <code>sceneRect().height()</code>.</p>
<p><b>See also </b><a href="qgraphicsscene.html#width">width</a>().</p>
<!-- @@@height -->
<!-- $$$helpEvent[overload1]$$$helpEventQGraphicsSceneHelpEvent* -->
<h3 class="fn" id="helpEvent"><a name="helpEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsScene::<span class="name">helpEvent</span>(<span class="type"><a href="qgraphicsscenehelpevent.html">QGraphicsSceneHelpEvent</a></span> *<i>helpEvent</i>)</h3>
<p>This event handler, for event <i>helpEvent</i>, can be reimplemented in a subclass to receive help events. The events are of type <a href="../qtcore/qevent.html#Type-enum">QEvent::ToolTip</a>, which are created when a tooltip is requested.</p>
<p>The default implementation shows the tooltip of the topmost visible item, i.e&#x2e;, the item with the highest z-value, at the mouse cursor position. If no item has a tooltip set, this function does nothing.</p>
<p>Note: See <a href="qgraphicsscene.html#items">items</a>() for a definition of which items are considered visible by this function.</p>
<p><b>See also </b><a href="qgraphicsitem.html#toolTip">QGraphicsItem::toolTip</a>() and <a href="qgraphicsscenehelpevent.html">QGraphicsSceneHelpEvent</a>.</p>
<!-- @@@helpEvent -->
<!-- $$$inputMethodEvent[overload1]$$$inputMethodEventQInputMethodEvent* -->
<h3 class="fn" id="inputMethodEvent"><a name="inputMethodEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsScene::<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 in a subclass to receive input method events for the scene.</p>
<p>The default implementation forwards the event to the <a href="qgraphicsscene.html#focusItem">focusItem</a>(). If no item currently has focus or the current focus item does not accept input methods, this function does nothing.</p>
<p><b>See also </b><a href="qgraphicsitem.html#inputMethodEvent">QGraphicsItem::inputMethodEvent</a>().</p>
<!-- @@@inputMethodEvent -->
<!-- $$$inputMethodQuery[overload1]$$$inputMethodQueryQt::InputMethodQuery -->
<h3 class="fn" id="inputMethodQuery"><a name="inputMethodQuery"></a><code>[virtual] </code><span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> QGraphicsScene::<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 used by input methods to query a set of properties of the scene to be able to support complex input method operations as support for surrounding text and reconversions.</p>
<p>The <i>query</i> parameter specifies which property is queried.</p>
<p><b>See also </b><a href="qwidget.html#inputMethodQuery">QWidget::inputMethodQuery</a>().</p>
<!-- @@@inputMethodQuery -->
<!-- $$$invalidate[overload1]$$$invalidateconstQRectF&SceneLayers -->
<h3 class="fn" id="invalidate"><a name="invalidate"></a><code>[slot] </code><span class="type">void</span> QGraphicsScene::<span class="name">invalidate</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i> = QRectF(), <span class="type"><a href="qgraphicsscene.html#SceneLayer-enum">SceneLayers</a></span> <i>layers</i> = AllLayers)</h3>
<p>Invalidates and schedules a redraw of the <i>layers</i> in <i>rect</i> on the scene. Any cached content in <i>layers</i> is unconditionally invalidated and redrawn.</p>
<p>You can use this function overload to notify <a href="qgraphicsscene.html">QGraphicsScene</a> of changes to the background or the foreground of the scene. This function is commonly used for scenes with tile-based backgrounds to notify changes when <a href="qgraphicsview.html">QGraphicsView</a> has enabled <a href="qgraphicsview.html#CacheModeFlag-enum">CacheBackground</a>.</p>
<p>Example:</p>
<pre class="cpp">

  <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> TileScene<span class="operator">::</span>rectForTile(<span class="type">int</span> x<span class="operator">,</span> <span class="type">int</span> y) <span class="keyword">const</span>
  {
      <span class="comment">// Return the rectangle for the tile at position (x, y).</span>
      <span class="keyword">return</span> <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span>(x <span class="operator">*</span> tileWidth<span class="operator">,</span> y <span class="operator">*</span> tileHeight<span class="operator">,</span> tileWidth<span class="operator">,</span> tileHeight);
  }

  <span class="type">void</span> TileScene<span class="operator">::</span>setTile(<span class="type">int</span> x<span class="operator">,</span> <span class="type">int</span> y<span class="operator">,</span> <span class="keyword">const</span> <span class="type"><a href="../qtgui/qpixmap.html">QPixmap</a></span> <span class="operator">&amp;</span>pixmap)
  {
      <span class="comment">// Sets or replaces the tile at position (x, y) with pixmap.</span>
      <span class="keyword">if</span> (x <span class="operator">&gt;</span><span class="operator">=</span> <span class="number">0</span> <span class="operator">&amp;</span><span class="operator">&amp;</span> x <span class="operator">&lt;</span> numTilesH <span class="operator">&amp;</span><span class="operator">&amp;</span> y <span class="operator">&gt;</span><span class="operator">=</span> <span class="number">0</span> <span class="operator">&amp;</span><span class="operator">&amp;</span> y <span class="operator">&lt;</span> numTilesV) {
          tiles<span class="operator">[</span>y<span class="operator">]</span><span class="operator">[</span>x<span class="operator">]</span> <span class="operator">=</span> pixmap;
          invalidate(rectForTile(x<span class="operator">,</span> y)<span class="operator">,</span> BackgroundLayer);
      }
  }

  <span class="type">void</span> TileScene<span class="operator">::</span>drawBackground(<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="../qtcore/qrectf.html">QRectF</a></span> <span class="operator">&amp;</span>exposed)
  {
      <span class="comment">// Draws all tiles that intersect the exposed area.</span>
      <span class="keyword">for</span> (<span class="type">int</span> y <span class="operator">=</span> <span class="number">0</span>; y <span class="operator">&lt;</span> numTilesV; <span class="operator">+</span><span class="operator">+</span>y) {
          <span class="keyword">for</span> (<span class="type">int</span> x <span class="operator">=</span> <span class="number">0</span>; x <span class="operator">&lt;</span> numTilesH; <span class="operator">+</span><span class="operator">+</span>x) {
              <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> rect <span class="operator">=</span> rectForTile(x<span class="operator">,</span> y);
              <span class="keyword">if</span> (exposed<span class="operator">.</span>intersects(rect))
                  painter<span class="operator">-</span><span class="operator">&gt;</span>drawPixmap(rect<span class="operator">.</span>topLeft()<span class="operator">,</span> tiles<span class="operator">[</span>y<span class="operator">]</span><span class="operator">[</span>x<span class="operator">]</span>);
          }
      }
  }

</pre>
<p>Note that <a href="qgraphicsview.html">QGraphicsView</a> currently supports background caching only (see <a href="qgraphicsview.html#CacheModeFlag-enum">QGraphicsView::CacheBackground</a>). This function is equivalent to calling <a href="qgraphicsscene.html#update">update</a>() if any layer but <a href="qgraphicsscene.html#SceneLayer-enum">BackgroundLayer</a> is passed.</p>
<p><b>See also </b><a href="qgraphicsview.html#resetCachedContent">QGraphicsView::resetCachedContent</a>().</p>
<!-- @@@invalidate -->
<!-- $$$invalidate$$$invalidateqrealqrealqrealqrealSceneLayers -->
<h3 class="fn" id="invalidate-1"><a name="invalidate-1"></a><span class="type">void</span> QGraphicsScene::<span class="name">invalidate</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"><a href="qgraphicsscene.html#SceneLayer-enum">SceneLayers</a></span> <i>layers</i> = AllLayers)</h3>
<p>This is an overloaded function.</p>
<p>This convenience function is equivalent to calling invalidate(<a href="../qtcore/qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>), <i>layers</i>);</p>
<p>This function was introduced in  Qt 4.3.</p>
<!-- @@@invalidate -->
<!-- $$$isActive[overload1]$$$isActive -->
<h3 class="fn" id="isActive"><a name="isActive"></a><span class="type">bool</span> QGraphicsScene::<span class="name">isActive</span>() const</h3>
<p>Returns <code>true</code> if the scene is active (e.g&#x2e;, it's viewed by at least one <a href="qgraphicsview.html">QGraphicsView</a> that is active); 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#isActive">QGraphicsItem::isActive</a>() and <a href="qwidget.html#isActiveWindow-prop">QWidget::isActiveWindow</a>().</p>
<!-- @@@isActive -->
<!-- $$$itemAt[overload1]$$$itemAtconstQPointF&constQTransform& -->
<h3 class="fn" id="itemAt"><a name="itemAt"></a><span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *QGraphicsScene::<span class="name">itemAt</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>position</i>, const <span class="type"><a href="../qtgui/qtransform.html">QTransform</a></span> &amp;<i>deviceTransform</i>) const</h3>
<p>Returns the topmost visible item at the specified <i>position</i>, or 0 if there are no items at this position.</p>
<p><i>deviceTransform</i> is the transformation that applies to the view, and needs to be provided if the scene contains items that ignore transformations.</p>
<p>Note: See <a href="qgraphicsscene.html#items">items</a>() for a definition of which items are considered visible by this function.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsscene.html#items">items</a>(), <a href="qgraphicsscene.html#collidingItems">collidingItems</a>(), and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p>
<!-- @@@itemAt -->
<!-- $$$itemAt$$$itemAtqrealqrealconstQTransform& -->
<h3 class="fn" id="itemAt-3"><a name="itemAt-3"></a><span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *QGraphicsScene::<span class="name">itemAt</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 <span class="type"><a href="../qtgui/qtransform.html">QTransform</a></span> &amp;<i>deviceTransform</i>) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the topmost visible item at the position specified by (<i>x</i>, <i>y</i>), or 0 if there are no items at this position.</p>
<p><i>deviceTransform</i> is the transformation that applies to the view, and needs to be provided if the scene contains items that ignore transformations.</p>
<p>This convenience function is equivalent to calling <code>itemAt(QPointF(x, y), deviceTransform)</code>.</p>
<p>Note: See <a href="qgraphicsscene.html#items">items</a>() for a definition of which items are considered visible by this function.</p>
<p>This function was introduced in  Qt 4.6.</p>
<!-- @@@itemAt -->
<!-- $$$items[overload1]$$$itemsQt::SortOrder -->
<h3 class="fn" id="items"><a name="items"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *&gt; QGraphicsScene::<span class="name">items</span>(<span class="type"><a href="../qtcore/qt.html#SortOrder-enum">Qt::SortOrder</a></span> <i>order</i> = Qt::DescendingOrder) const</h3>
<p>Returns an ordered list of all items on the scene. <i>order</i> decides the stacking order.</p>
<p><b>See also </b><a href="qgraphicsscene.html#addItem">addItem</a>(), <a href="qgraphicsscene.html#removeItem">removeItem</a>(), and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p>
<!-- @@@items -->
<!-- $$$items$$$itemsconstQPointF&Qt::ItemSelectionModeQt::SortOrderconstQTransform& -->
<h3 class="fn" id="items-1"><a name="items-1"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *&gt; QGraphicsScene::<span class="name">items</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>pos</i>, <span class="type"><a href="../qtcore/qt.html#ItemSelectionMode-enum">Qt::ItemSelectionMode</a></span> <i>mode</i> = Qt::IntersectsItemShape, <span class="type"><a href="../qtcore/qt.html#SortOrder-enum">Qt::SortOrder</a></span> <i>order</i> = Qt::DescendingOrder, const <span class="type"><a href="../qtgui/qtransform.html">QTransform</a></span> &amp;<i>deviceTransform</i> = QTransform()) const</h3>
<p>Returns all visible items that, depending on <i>mode</i>, are at the specified <i>pos</i> in a list sorted using <i>order</i>. In this case, &quot;visible&quot; defines items for which: isVisible() returns <code>true</code>, effectiveOpacity() returns a value greater than 0.0 (which is fully transparent) and the parent item does not clip it.</p>
<p>The default value for <i>mode</i> is <a href="../qtcore/qt.html#ItemSelectionMode-enum">Qt::IntersectsItemShape</a>; all items whose exact shape intersects with <i>pos</i> are returned.</p>
<p><i>deviceTransform</i> is the transformation that applies to the view, and needs to be provided if the scene contains items that ignore transformations.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsscene.html#itemAt">itemAt</a>() and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p>
<!-- @@@items -->
<!-- $$$items$$$itemsconstQRectF&Qt::ItemSelectionModeQt::SortOrderconstQTransform& -->
<h3 class="fn" id="items-2"><a name="items-2"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *&gt; QGraphicsScene::<span class="name">items</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>, <span class="type"><a href="../qtcore/qt.html#ItemSelectionMode-enum">Qt::ItemSelectionMode</a></span> <i>mode</i> = Qt::IntersectsItemShape, <span class="type"><a href="../qtcore/qt.html#SortOrder-enum">Qt::SortOrder</a></span> <i>order</i> = Qt::DescendingOrder, const <span class="type"><a href="../qtgui/qtransform.html">QTransform</a></span> &amp;<i>deviceTransform</i> = QTransform()) const</h3>
<p>This is an overloaded function.</p>
<p>Returns all visible items that, depending on <i>mode</i>, are either inside or intersect with the specified <i>rect</i>, in a list sorted using <i>order</i>. In this case, &quot;visible&quot; defines items for which: isVisible() returns <code>true</code>, effectiveOpacity() returns a value greater than 0.0 (which is fully transparent) and the parent item does not clip it.</p>
<p>The default value for <i>mode</i> is <a href="../qtcore/qt.html#ItemSelectionMode-enum">Qt::IntersectsItemShape</a>; all items whose exact shape intersects with or is contained by <i>rect</i> are returned.</p>
<p><i>deviceTransform</i> is the transformation that applies to the view, and needs to be provided if the scene contains items that ignore transformations.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsscene.html#itemAt">itemAt</a>() and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p>
<!-- @@@items -->
<!-- $$$items$$$itemsconstQPolygonF&Qt::ItemSelectionModeQt::SortOrderconstQTransform& -->
<h3 class="fn" id="items-3"><a name="items-3"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *&gt; QGraphicsScene::<span class="name">items</span>(const <span class="type"><a href="../qtgui/qpolygonf.html">QPolygonF</a></span> &amp;<i>polygon</i>, <span class="type"><a href="../qtcore/qt.html#ItemSelectionMode-enum">Qt::ItemSelectionMode</a></span> <i>mode</i> = Qt::IntersectsItemShape, <span class="type"><a href="../qtcore/qt.html#SortOrder-enum">Qt::SortOrder</a></span> <i>order</i> = Qt::DescendingOrder, const <span class="type"><a href="../qtgui/qtransform.html">QTransform</a></span> &amp;<i>deviceTransform</i> = QTransform()) const</h3>
<p>This is an overloaded function.</p>
<p>Returns all visible items that, depending on <i>mode</i>, are either inside or intersect with the specified <i>polygon</i>, in a list sorted using <i>order</i>. In this case, &quot;visible&quot; defines items for which: isVisible() returns <code>true</code>, effectiveOpacity() returns a value greater than 0.0 (which is fully transparent) and the parent item does not clip it.</p>
<p>The default value for <i>mode</i> is <a href="../qtcore/qt.html#ItemSelectionMode-enum">Qt::IntersectsItemShape</a>; all items whose exact shape intersects with or is contained by <i>polygon</i> are returned.</p>
<p><i>deviceTransform</i> is the transformation that applies to the view, and needs to be provided if the scene contains items that ignore transformations.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsscene.html#itemAt">itemAt</a>() and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p>
<!-- @@@items -->
<!-- $$$items$$$itemsconstQPainterPath&Qt::ItemSelectionModeQt::SortOrderconstQTransform& -->
<h3 class="fn" id="items-4"><a name="items-4"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *&gt; QGraphicsScene::<span class="name">items</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, <span class="type"><a href="../qtcore/qt.html#SortOrder-enum">Qt::SortOrder</a></span> <i>order</i> = Qt::DescendingOrder, const <span class="type"><a href="../qtgui/qtransform.html">QTransform</a></span> &amp;<i>deviceTransform</i> = QTransform()) const</h3>
<p>This is an overloaded function.</p>
<p>Returns all visible items that, depending on <i>mode</i>, are either inside or intersect with the specified <i>path</i>, in a list sorted using <i>order</i>. In this case, &quot;visible&quot; defines items for which: isVisible() returns <code>true</code>, effectiveOpacity() returns a value greater than 0.0 (which is fully transparent) and the parent item does not clip it.</p>
<p>The default value for <i>mode</i> is <a href="../qtcore/qt.html#ItemSelectionMode-enum">Qt::IntersectsItemShape</a>; all items whose exact shape intersects with or is contained by <i>path</i> are returned.</p>
<p><i>deviceTransform</i> is the transformation that applies to the view, and needs to be provided if the scene contains items that ignore transformations.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsscene.html#itemAt">itemAt</a>() and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p>
<!-- @@@items -->
<!-- $$$items$$$itemsqrealqrealqrealqrealQt::ItemSelectionModeQt::SortOrderconstQTransform& -->
<h3 class="fn" id="items-6"><a name="items-6"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *&gt; QGraphicsScene::<span class="name">items</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"><a href="../qtcore/qt.html#ItemSelectionMode-enum">Qt::ItemSelectionMode</a></span> <i>mode</i>, <span class="type"><a href="../qtcore/qt.html#SortOrder-enum">Qt::SortOrder</a></span> <i>order</i>, const <span class="type"><a href="../qtgui/qtransform.html">QTransform</a></span> &amp;<i>deviceTransform</i> = QTransform()) const</h3>
<p>This is an overloaded function.</p>
<p>Returns all visible items that, depending on <i>mode</i>, are either inside or intersect with the rectangle defined by <i>x</i>, <i>y</i>, <i>w</i> and <i>h</i>, in a list sorted using <i>order</i>. In this case, &quot;visible&quot; defines items for which: isVisible() returns <code>true</code>, effectiveOpacity() returns a value greater than 0.0 (which is fully transparent) and the parent item does not clip it.</p>
<p><i>deviceTransform</i> is the transformation that applies to the view, and needs to be provided if the scene contains items that ignore transformations.</p>
<p>This function was introduced in  Qt 4.6.</p>
<!-- @@@items -->
<!-- $$$itemsBoundingRect[overload1]$$$itemsBoundingRect -->
<h3 class="fn" id="itemsBoundingRect"><a name="itemsBoundingRect"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsScene::<span class="name">itemsBoundingRect</span>() const</h3>
<p>Calculates and returns the bounding rect of all items on the scene. This function works by iterating over all items, and because of this, it can be slow for large scenes.</p>
<p><b>See also </b><a href="qgraphicsscene.html#sceneRect-prop">sceneRect</a>().</p>
<!-- @@@itemsBoundingRect -->
<!-- $$$keyPressEvent[overload1]$$$keyPressEventQKeyEvent* -->
<h3 class="fn" id="keyPressEvent"><a name="keyPressEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsScene::<span class="name">keyPressEvent</span>(<span class="type"><a href="../qtgui/qkeyevent.html">QKeyEvent</a></span> *<i>keyEvent</i>)</h3>
<p>This event handler, for event <i>keyEvent</i>, can be reimplemented in a subclass to receive keypress events. The default implementation forwards the event to current focus item.</p>
<p><b>See also </b><a href="qgraphicsitem.html#keyPressEvent">QGraphicsItem::keyPressEvent</a>() and <a href="qgraphicsscene.html#focusItem">focusItem</a>().</p>
<!-- @@@keyPressEvent -->
<!-- $$$keyReleaseEvent[overload1]$$$keyReleaseEventQKeyEvent* -->
<h3 class="fn" id="keyReleaseEvent"><a name="keyReleaseEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsScene::<span class="name">keyReleaseEvent</span>(<span class="type"><a href="../qtgui/qkeyevent.html">QKeyEvent</a></span> *<i>keyEvent</i>)</h3>
<p>This event handler, for event <i>keyEvent</i>, can be reimplemented in a subclass to receive key release events. The default implementation forwards the event to current focus item.</p>
<p><b>See also </b><a href="qgraphicsitem.html#keyReleaseEvent">QGraphicsItem::keyReleaseEvent</a>() and <a href="qgraphicsscene.html#focusItem">focusItem</a>().</p>
<!-- @@@keyReleaseEvent -->
<!-- $$$mouseDoubleClickEvent[overload1]$$$mouseDoubleClickEventQGraphicsSceneMouseEvent* -->
<h3 class="fn" id="mouseDoubleClickEvent"><a name="mouseDoubleClickEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsScene::<span class="name">mouseDoubleClickEvent</span>(<span class="type"><a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a></span> *<i>mouseEvent</i>)</h3>
<p>This event handler, for event <i>mouseEvent</i>, can be reimplemented in a subclass to receive mouse doubleclick events for the scene.</p>
<p>If someone doubleclicks on the scene, the scene 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. If the doubleclick event is delivered to a different item than the one that received the first press and release, it will be delivered as a press event. However, tripleclick events are not delivered as doubleclick events in this case.</p>
<p>The default implementation is similar to <a href="qgraphicsscene.html#mousePressEvent">mousePressEvent</a>().</p>
<p>Note: See <a href="qgraphicsscene.html#items">items</a>() for a definition of which items are considered visible by this function.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mousePressEvent">QGraphicsItem::mousePressEvent</a>(), <a href="qgraphicsitem.html#mouseMoveEvent">QGraphicsItem::mouseMoveEvent</a>(), <a href="qgraphicsitem.html#mouseReleaseEvent">QGraphicsItem::mouseReleaseEvent</a>(), and <a href="qgraphicsitem.html#setAcceptedMouseButtons">QGraphicsItem::setAcceptedMouseButtons</a>().</p>
<!-- @@@mouseDoubleClickEvent -->
<!-- $$$mouseGrabberItem[overload1]$$$mouseGrabberItem -->
<h3 class="fn" id="mouseGrabberItem"><a name="mouseGrabberItem"></a><span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *QGraphicsScene::<span class="name">mouseGrabberItem</span>() const</h3>
<p>Returns the current mouse grabber item, or 0 if no item is currently grabbing the mouse. The mouse grabber item is the item that receives all mouse events sent to the scene.</p>
<p>An item becomes a mouse grabber when it receives and accepts a mouse press event, and it stays the mouse grabber until either of the following events occur:</p>
<ul>
<li>If the item receives a mouse release event when there are no other buttons pressed, it loses the mouse grab.</li>
<li>If the item becomes invisible (i.e&#x2e;, someone calls <code>item-&gt;setVisible(false)</code>), or if it becomes disabled (i.e&#x2e;, someone calls <code>item-&gt;setEnabled(false)</code>), it loses the mouse grab.</li>
<li>If the item is removed from the scene, it loses the mouse grab.</li>
</ul>
<p>If the item loses its mouse grab, the scene will ignore all mouse events until a new item grabs the mouse (i.e&#x2e;, until a new item receives a mouse press event).</p>
<!-- @@@mouseGrabberItem -->
<!-- $$$mouseMoveEvent[overload1]$$$mouseMoveEventQGraphicsSceneMouseEvent* -->
<h3 class="fn" id="mouseMoveEvent"><a name="mouseMoveEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsScene::<span class="name">mouseMoveEvent</span>(<span class="type"><a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a></span> *<i>mouseEvent</i>)</h3>
<p>This event handler, for event <i>mouseEvent</i>, can be reimplemented in a subclass to receive mouse move events for the scene.</p>
<p>The default implementation depends on the mouse grabber state. If there is a mouse grabber item, the event is sent to the mouse grabber. If there are any items that accept hover events at the current position, the event is translated into a hover event and accepted; otherwise it's ignored.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mousePressEvent">QGraphicsItem::mousePressEvent</a>(), <a href="qgraphicsitem.html#mouseReleaseEvent">QGraphicsItem::mouseReleaseEvent</a>(), <a href="qgraphicsitem.html#mouseDoubleClickEvent">QGraphicsItem::mouseDoubleClickEvent</a>(), and <a href="qgraphicsitem.html#setAcceptedMouseButtons">QGraphicsItem::setAcceptedMouseButtons</a>().</p>
<!-- @@@mouseMoveEvent -->
<!-- $$$mousePressEvent[overload1]$$$mousePressEventQGraphicsSceneMouseEvent* -->
<h3 class="fn" id="mousePressEvent"><a name="mousePressEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsScene::<span class="name">mousePressEvent</span>(<span class="type"><a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a></span> *<i>mouseEvent</i>)</h3>
<p>This event handler, for event <i>mouseEvent</i>, can be reimplemented in a subclass to receive mouse press events for the scene.</p>
<p>The default implementation depends on the state of the scene. If there is a mouse grabber item, then the event is sent to the mouse grabber. Otherwise, it is forwarded to the topmost visible item that accepts mouse events at the scene position from the event, and that item promptly becomes the mouse grabber item.</p>
<p>If there is no item at the given position on the scene, the selection area is reset, any focus item loses its input focus, and the event is then ignored.</p>
<p>Note: See <a href="qgraphicsscene.html#items">items</a>() for a definition of which items are considered visible by this function.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mousePressEvent">QGraphicsItem::mousePressEvent</a>() and <a href="qgraphicsitem.html#setAcceptedMouseButtons">QGraphicsItem::setAcceptedMouseButtons</a>().</p>
<!-- @@@mousePressEvent -->
<!-- $$$mouseReleaseEvent[overload1]$$$mouseReleaseEventQGraphicsSceneMouseEvent* -->
<h3 class="fn" id="mouseReleaseEvent"><a name="mouseReleaseEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsScene::<span class="name">mouseReleaseEvent</span>(<span class="type"><a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a></span> *<i>mouseEvent</i>)</h3>
<p>This event handler, for event <i>mouseEvent</i>, can be reimplemented in a subclass to receive mouse release events for the scene.</p>
<p>The default implementation depends on the mouse grabber state. If there is no mouse grabber, the event is ignored. Otherwise, if there is a mouse grabber item, the event is sent to the mouse grabber. If this mouse release represents the last pressed button on the mouse, the mouse grabber item then loses the mouse grab.</p>
<p><b>See also </b><a href="qgraphicsitem.html#mousePressEvent">QGraphicsItem::mousePressEvent</a>(), <a href="qgraphicsitem.html#mouseMoveEvent">QGraphicsItem::mouseMoveEvent</a>(), <a href="qgraphicsitem.html#mouseDoubleClickEvent">QGraphicsItem::mouseDoubleClickEvent</a>(), and <a href="qgraphicsitem.html#setAcceptedMouseButtons">QGraphicsItem::setAcceptedMouseButtons</a>().</p>
<!-- @@@mouseReleaseEvent -->
<!-- $$$removeItem[overload1]$$$removeItemQGraphicsItem* -->
<h3 class="fn" id="removeItem"><a name="removeItem"></a><span class="type">void</span> QGraphicsScene::<span class="name">removeItem</span>(<span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *<i>item</i>)</h3>
<p>Removes the item <i>item</i> and all its children from the scene. The ownership of <i>item</i> is passed on to the caller (i.e&#x2e;, <a href="qgraphicsscene.html">QGraphicsScene</a> will no longer delete <i>item</i> when destroyed).</p>
<p><b>See also </b><a href="qgraphicsscene.html#addItem">addItem</a>().</p>
<!-- @@@removeItem -->
<!-- $$$render[overload1]$$$renderQPainter*constQRectF&constQRectF&Qt::AspectRatioMode -->
<h3 class="fn" id="render"><a name="render"></a><span class="type">void</span> QGraphicsScene::<span class="name">render</span>(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> *<i>painter</i>, const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>target</i> = QRectF(), const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>source</i> = QRectF(), <span class="type"><a href="../qtcore/qt.html#AspectRatioMode-enum">Qt::AspectRatioMode</a></span> <i>aspectRatioMode</i> = Qt::KeepAspectRatio)</h3>
<p>Renders the <i>source</i> rect from scene into <i>target</i>, using <i>painter</i>. This function is useful for capturing the contents of the scene onto a paint device, such as a <a href="../qtgui/qimage.html">QImage</a> (e.g&#x2e;, to take a screenshot), or for printing with QPrinter. For example:</p>
<pre class="cpp">

  <span class="type"><a href="qgraphicsscene.html#QGraphicsScene">QGraphicsScene</a></span> scene;
  scene<span class="operator">.</span>addItem(<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
  <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
  <span class="type">QPrinter</span> printer(<span class="type">QPrinter</span><span class="operator">::</span>HighResolution);
  printer<span class="operator">.</span>setPaperSize(<span class="type">QPrinter</span><span class="operator">::</span>A4);

  <span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> painter(<span class="operator">&amp;</span>printer);
  scene<span class="operator">.</span>render(<span class="operator">&amp;</span>painter);

</pre>
<p>If <i>source</i> is a null rect, this function will use <a href="qgraphicsscene.html#sceneRect-prop">sceneRect</a>() to determine what to render. If <i>target</i> is a null rect, the dimensions of <i>painter</i>'s paint device will be used.</p>
<p>The source rect contents will be transformed according to <i>aspectRatioMode</i> to fit into the target rect. By default, the aspect ratio is kept, and <i>source</i> is scaled to fit in <i>target</i>.</p>
<p><b>See also </b><a href="qgraphicsview.html#render">QGraphicsView::render</a>().</p>
<!-- @@@render -->
<!-- $$$sceneRectChanged[overload1]$$$sceneRectChangedconstQRectF& -->
<h3 class="fn" id="sceneRectChanged"><a name="sceneRectChanged"></a><code>[signal] </code><span class="type">void</span> QGraphicsScene::<span class="name">sceneRectChanged</span>(const <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> &amp;<i>rect</i>)</h3>
<p>This signal is emitted by <a href="qgraphicsscene.html">QGraphicsScene</a> whenever the scene rect changes. The <i>rect</i> parameter is the new scene rectangle.</p>
<p><b>See also </b><a href="qgraphicsview.html#updateSceneRect">QGraphicsView::updateSceneRect</a>().</p>
<!-- @@@sceneRectChanged -->
<!-- $$$selectedItems[overload1]$$$selectedItems -->
<h3 class="fn" id="selectedItems"><a name="selectedItems"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *&gt; QGraphicsScene::<span class="name">selectedItems</span>() const</h3>
<p>Returns a list of all currently selected items. The items are returned in no particular order.</p>
<p><b>See also </b><a href="qgraphicsscene.html#setSelectionArea">setSelectionArea</a>().</p>
<!-- @@@selectedItems -->
<!-- $$$selectionArea[overload1]$$$selectionArea -->
<h3 class="fn" id="selectionArea"><a name="selectionArea"></a><span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> QGraphicsScene::<span class="name">selectionArea</span>() const</h3>
<p>Returns the selection area that was previously set with <a href="qgraphicsscene.html#setSelectionArea">setSelectionArea</a>(), or an empty <a href="../qtgui/qpainterpath.html">QPainterPath</a> if no selection area has been set.</p>
<p><b>See also </b><a href="qgraphicsscene.html#setSelectionArea">setSelectionArea</a>().</p>
<!-- @@@selectionArea -->
<!-- $$$selectionChanged[overload1]$$$selectionChanged -->
<h3 class="fn" id="selectionChanged"><a name="selectionChanged"></a><code>[signal] </code><span class="type">void</span> QGraphicsScene::<span class="name">selectionChanged</span>()</h3>
<p>This signal is emitted by <a href="qgraphicsscene.html">QGraphicsScene</a> whenever the selection changes. You can call <a href="qgraphicsscene.html#selectedItems">selectedItems</a>() to get the new list of selected items.</p>
<p>The selection changes whenever an item is selected or unselected, a selection area is set, cleared or otherwise changed, if a preselected item is added to the scene, or if a selected item is removed from the scene.</p>
<p><a href="qgraphicsscene.html">QGraphicsScene</a> emits this signal only once for group selection operations. For example, if you set a selection area, select or unselect a <a href="qgraphicsitemgroup.html">QGraphicsItemGroup</a>, or if you add or remove from the scene a parent item that contains several selected items, selectionChanged() is emitted only once after the operation has completed (instead of once for each item).</p>
<p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="qgraphicsscene.html#setSelectionArea">setSelectionArea</a>(), <a href="qgraphicsscene.html#selectedItems">selectedItems</a>(), and <a href="qgraphicsitem.html#setSelected">QGraphicsItem::setSelected</a>().</p>
<!-- @@@selectionChanged -->
<!-- $$$sendEvent[overload1]$$$sendEventQGraphicsItem*QEvent* -->
<h3 class="fn" id="sendEvent"><a name="sendEvent"></a><span class="type">bool</span> QGraphicsScene::<span class="name">sendEvent</span>(<span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *<i>item</i>, <span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>event</i>)</h3>
<p>Sends event <i>event</i> to item <i>item</i> through possible event filters.</p>
<p>The event is sent only if the item is enabled.</p>
<p>Returns <code>false</code> if the event was filtered or if the item is disabled. Otherwise returns the value that was returned from the event handler.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsitem.html#sceneEvent">QGraphicsItem::sceneEvent</a>() and <a href="qgraphicsitem.html#sceneEventFilter">QGraphicsItem::sceneEventFilter</a>().</p>
<!-- @@@sendEvent -->
<!-- $$$setActivePanel[overload1]$$$setActivePanelQGraphicsItem* -->
<h3 class="fn" id="setActivePanel"><a name="setActivePanel"></a><span class="type">void</span> QGraphicsScene::<span class="name">setActivePanel</span>(<span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *<i>item</i>)</h3>
<p>Activates <i>item</i>, which must be an item in this scene. You can also pass 0 for <i>item</i>, in which case <a href="qgraphicsscene.html">QGraphicsScene</a> will deactivate any currently active panel.</p>
<p>If the scene is currently inactive, <i>item</i> remains inactive until the scene becomes active (or, ir <i>item</i> is 0, no item will be activated).</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsscene.html#activePanel">activePanel</a>(), <a href="qgraphicsscene.html#isActive">isActive</a>(), and <a href="qgraphicsitem.html#isActive">QGraphicsItem::isActive</a>().</p>
<!-- @@@setActivePanel -->
<!-- $$$setActiveWindow[overload1]$$$setActiveWindowQGraphicsWidget* -->
<h3 class="fn" id="setActiveWindow"><a name="setActiveWindow"></a><span class="type">void</span> QGraphicsScene::<span class="name">setActiveWindow</span>(<span class="type"><a href="qgraphicswidget.html">QGraphicsWidget</a></span> *<i>widget</i>)</h3>
<p>Activates <i>widget</i>, which must be a widget in this scene. You can also pass 0 for <i>widget</i>, in which case <a href="qgraphicsscene.html">QGraphicsScene</a> will deactivate any currently active window.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsscene.html#activeWindow">activeWindow</a>() and <a href="qgraphicswidget.html#isActiveWindow">QGraphicsWidget::isActiveWindow</a>().</p>
<!-- @@@setActiveWindow -->
<!-- $$$setFocus[overload1]$$$setFocusQt::FocusReason -->
<h3 class="fn" id="setFocus"><a name="setFocus"></a><span class="type">void</span> QGraphicsScene::<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>Sets focus on the scene by sending a <a href="../qtgui/qfocusevent.html">QFocusEvent</a> to the scene, passing <i>focusReason</i> as the reason. If the scene regains focus after having previously lost it while an item had focus, the last focus item will receive focus with <i>focusReason</i> as the reason.</p>
<p>If the scene already has focus, this function does nothing.</p>
<p><b>See also </b><a href="qgraphicsscene.html#hasFocus">hasFocus</a>(), <a href="qgraphicsscene.html#clearFocus">clearFocus</a>(), and <a href="qgraphicsscene.html#setFocusItem">setFocusItem</a>().</p>
<!-- @@@setFocus -->
<!-- $$$setFocusItem[overload1]$$$setFocusItemQGraphicsItem*Qt::FocusReason -->
<h3 class="fn" id="setFocusItem"><a name="setFocusItem"></a><span class="type">void</span> QGraphicsScene::<span class="name">setFocusItem</span>(<span class="type"><a href="qgraphicsitem.html">QGraphicsItem</a></span> *<i>item</i>, <span class="type"><a href="../qtcore/qt.html#FocusReason-enum">Qt::FocusReason</a></span> <i>focusReason</i> = Qt::OtherFocusReason)</h3>
<p>Sets the scene's focus item to <i>item</i>, with the focus reason <i>focusReason</i>, after removing focus from any previous item that may have had focus.</p>
<p>If <i>item</i> is 0, or if it either does not accept focus (i.e&#x2e;, it does not have the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">QGraphicsItem::ItemIsFocusable</a> flag enabled), or is not visible or not enabled, this function only removes focus from any previous focusitem.</p>
<p>If item is not 0, and the scene does not currently have focus (i.e&#x2e;, <a href="qgraphicsscene.html#hasFocus">hasFocus</a>() returns <code>false</code>), this function will call <a href="qgraphicsscene.html#setFocus">setFocus</a>() automatically.</p>
<p><b>See also </b><a href="qgraphicsscene.html#focusItem">focusItem</a>(), <a href="qgraphicsscene.html#hasFocus">hasFocus</a>(), and <a href="qgraphicsscene.html#setFocus">setFocus</a>().</p>
<!-- @@@setFocusItem -->
<!-- $$$setSelectionArea[overload1]$$$setSelectionAreaconstQPainterPath&constQTransform& -->
<h3 class="fn" id="setSelectionArea"><a name="setSelectionArea"></a><span class="type">void</span> QGraphicsScene::<span class="name">setSelectionArea</span>(const <span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> &amp;<i>path</i>, const <span class="type"><a href="../qtgui/qtransform.html">QTransform</a></span> &amp;<i>deviceTransform</i>)</h3>
<p>Sets the selection area to <i>path</i>. All items within this area are immediately selected, and all items outside are unselected. You can get the list of all selected items by calling <a href="qgraphicsscene.html#selectedItems">selectedItems</a>().</p>
<p><i>deviceTransform</i> is the transformation that applies to the view, and needs to be provided if the scene contains items that ignore transformations.</p>
<p>For an item to be selected, it must be marked as <i>selectable</i> (<a href="qgraphicsitem.html#GraphicsItemFlag-enum">QGraphicsItem::ItemIsSelectable</a>).</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsscene.html#clearSelection">clearSelection</a>() and <a href="qgraphicsscene.html#selectionArea">selectionArea</a>().</p>
<!-- @@@setSelectionArea -->
<!-- $$$setSelectionArea$$$setSelectionAreaconstQPainterPath&Qt::ItemSelectionModeconstQTransform& -->
<h3 class="fn" id="setSelectionArea-1"><a name="setSelectionArea-1"></a><span class="type">void</span> QGraphicsScene::<span class="name">setSelectionArea</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 <span class="type"><a href="../qtgui/qtransform.html">QTransform</a></span> &amp;<i>deviceTransform</i> = QTransform())</h3>
<p>This is an overloaded function.</p>
<p>Sets the selection area to <i>path</i> using <i>mode</i> to determine if items are included in the selection area.</p>
<p><i>deviceTransform</i> is the transformation that applies to the view, and needs to be provided if the scene contains items that ignore transformations.</p>
<p>This function was introduced in  Qt 4.6.</p>
<p><b>See also </b><a href="qgraphicsscene.html#clearSelection">clearSelection</a>() and <a href="qgraphicsscene.html#selectionArea">selectionArea</a>().</p>
<!-- @@@setSelectionArea -->
<!-- $$$setSelectionArea$$$setSelectionAreaconstQPainterPath&Qt::ItemSelectionOperationQt::ItemSelectionModeconstQTransform& -->
<h3 class="fn" id="setSelectionArea-2"><a name="setSelectionArea-2"></a><span class="type">void</span> QGraphicsScene::<span class="name">setSelectionArea</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#ItemSelectionOperation-enum">Qt::ItemSelectionOperation</a></span> <i>selectionOperation</i>, <span class="type"><a href="../qtcore/qt.html#ItemSelectionMode-enum">Qt::ItemSelectionMode</a></span> <i>mode</i> = Qt::IntersectsItemShape, const <span class="type"><a href="../qtgui/qtransform.html">QTransform</a></span> &amp;<i>deviceTransform</i> = QTransform())</h3>
<p>This is an overloaded function.</p>
<p>Sets the selection area to <i>path</i> using <i>mode</i> to determine if items are included in the selection area.</p>
<p><i>deviceTransform</i> is the transformation that applies to the view, and needs to be provided if the scene contains items that ignore transformations.</p>
<p><i>selectionOperation</i> determines what to do with the currently selected items.</p>
<p>This function was introduced in  Qt 5.5.</p>
<p><b>See also </b><a href="qgraphicsscene.html#clearSelection">clearSelection</a>() and <a href="qgraphicsscene.html#selectionArea">selectionArea</a>().</p>
<!-- @@@setSelectionArea -->
<!-- $$$setStyle[overload1]$$$setStyleQStyle* -->
<h3 class="fn" id="setStyle"><a name="setStyle"></a><span class="type">void</span> QGraphicsScene::<span class="name">setStyle</span>(<span class="type"><a href="qstyle.html">QStyle</a></span> *<i>style</i>)</h3>
<p>Sets or replaces the style of the scene to <i>style</i>, and reparents the style to this scene. Any previously assigned style is deleted. The scene's style defaults to <a href="qapplication.html#style">QApplication::style</a>(), and serves as the default for all <a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> items in the scene.</p>
<p>Changing the style, either directly by calling this function, or indirectly by calling <a href="qapplication.html#setStyle">QApplication::setStyle</a>(), will automatically update the style for all widgets in the scene that do not have a style explicitly assigned to them.</p>
<p>If <i>style</i> is 0, <a href="qgraphicsscene.html">QGraphicsScene</a> will revert to <a href="qapplication.html#style">QApplication::style</a>().</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsscene.html#style">style</a>().</p>
<!-- @@@setStyle -->
<!-- $$$style[overload1]$$$style -->
<h3 class="fn" id="style"><a name="style"></a><span class="type"><a href="qstyle.html">QStyle</a></span> *QGraphicsScene::<span class="name">style</span>() const</h3>
<p>Returns the scene's style, or the same as <a href="qapplication.html#style">QApplication::style</a>() if the scene has not been explicitly assigned a style.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qgraphicsscene.html#setStyle">setStyle</a>().</p>
<!-- @@@style -->
<!-- $$$update[overload1]$$$updateconstQRectF& -->
<h3 class="fn" id="update"><a name="update"></a><code>[slot] </code><span class="type">void</span> QGraphicsScene::<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 <i>rect</i> on the scene.</p>
<p><b>See also </b><a href="qgraphicsscene.html#sceneRect-prop">sceneRect</a>() and <a href="qgraphicsscene.html#changed">changed</a>().</p>
<!-- @@@update -->
<!-- $$$update$$$updateqrealqrealqrealqreal -->
<h3 class="fn" id="update-1"><a name="update-1"></a><span class="type">void</span> QGraphicsScene::<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>w</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>)</h3>
<p>This is an overloaded function.</p>
<p>This function is equivalent to calling update(<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>
<!-- @@@update -->
<!-- $$$views[overload1]$$$views -->
<h3 class="fn" id="views"><a name="views"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qgraphicsview.html">QGraphicsView</a></span> *&gt; QGraphicsScene::<span class="name">views</span>() const</h3>
<p>Returns a list of all the views that display this scene.</p>
<p><b>See also </b><a href="qgraphicsview.html#scene">QGraphicsView::scene</a>().</p>
<!-- @@@views -->
<!-- $$$wheelEvent[overload1]$$$wheelEventQGraphicsSceneWheelEvent* -->
<h3 class="fn" id="wheelEvent"><a name="wheelEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsScene::<span class="name">wheelEvent</span>(<span class="type"><a href="qgraphicsscenewheelevent.html">QGraphicsSceneWheelEvent</a></span> *<i>wheelEvent</i>)</h3>
<p>This event handler, for event <i>wheelEvent</i>, can be reimplemented in a subclass to receive mouse wheel events for the scene.</p>
<p>By default, the event is delivered to the topmost visible item under the cursor. If ignored, the event propagates to the item beneath, and again until the event is accepted, or it reaches the scene. If no items accept the event, it is ignored.</p>
<p>Note: See <a href="qgraphicsscene.html#items">items</a>() for a definition of which items are considered visible by this function.</p>
<p><b>See also </b><a href="qgraphicsitem.html#wheelEvent">QGraphicsItem::wheelEvent</a>().</p>
<!-- @@@wheelEvent -->
<!-- $$$width[overload1]$$$width -->
<h3 class="fn" id="width"><a name="width"></a><span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> QGraphicsScene::<span class="name">width</span>() const</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicsscene.html#sceneRect-prop">sceneRect</a>().width().</p>
<p><b>See also </b><a href="qgraphicsscene.html#height">height</a>().</p>
<!-- @@@width -->
</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>