<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!-- qgraphicsscene.cpp --> <head> <title>Qt 4.6: Obsolete Members for QGraphicsScene</title> <link href="classic.css" rel="stylesheet" type="text/css" /> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td> <td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="functions.html"><font color="#004faf">All Functions</font></a> · <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">Obsolete Members for QGraphicsScene</h1> <p><b>The following class members are obsolete.</b> They are provided to keep old source code working. We strongly advise against using them in new code.</p> <p><ul><li><a href="qgraphicsscene.html">QGraphicsScene class reference</a></li></ul></p> <h2>Properties</h2> <ul> <li><div class="fn"><b><a href="qgraphicsscene-obsolete.html#sortCacheEnabled-prop">sortCacheEnabled</a></b> : bool <tt> (obsolete)</tt></div></li> </ul> <h2>Public Functions</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top">QGraphicsItem * </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsscene-obsolete.html#itemAt-2">itemAt</a></b> ( const QPointF & <i>position</i> ) const <tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft" align="right" valign="top">QGraphicsItem * </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsscene-obsolete.html#itemAt-4">itemAt</a></b> ( qreal <i>x</i>, qreal <i>y</i> ) const <tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft" align="right" valign="top">QList<QGraphicsItem *> </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsscene-obsolete.html#items-4">items</a></b> ( const QPointF & <i>pos</i> ) const <tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft" align="right" valign="top">QList<QGraphicsItem *> </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsscene-obsolete.html#items-5">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::IntersectsItemShape ) const <tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft" align="right" valign="top">QList<QGraphicsItem *> </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsscene-obsolete.html#items-6">items</a></b> ( const QRectF & <i>rectangle</i>, Qt::ItemSelectionMode <i>mode</i> = Qt::IntersectsItemShape ) const <tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft" align="right" valign="top">QList<QGraphicsItem *> </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsscene-obsolete.html#items-8">items</a></b> ( const QPolygonF & <i>polygon</i>, Qt::ItemSelectionMode <i>mode</i> = Qt::IntersectsItemShape ) const <tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft" align="right" valign="top">QList<QGraphicsItem *> </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsscene-obsolete.html#items-9">items</a></b> ( const QPainterPath & <i>path</i>, Qt::ItemSelectionMode <i>mode</i> = Qt::IntersectsItemShape ) const <tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsscene-obsolete.html#setSelectionArea-2">setSelectionArea</a></b> ( const QPainterPath & <i>path</i> ) <tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsscene-obsolete.html#setSelectionArea-3">setSelectionArea</a></b> ( const QPainterPath & <i>path</i>, Qt::ItemSelectionMode <i>mode</i> ) <tt> (obsolete)</tt></td></tr> </table> <h2>Protected Functions</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsscene-obsolete.html#drawItems">drawItems</a></b> ( QPainter * <i>painter</i>, int <i>numItems</i>, QGraphicsItem *[] <i>items</i>, const QStyleOptionGraphicsItem[] <i>options</i>, QWidget * <i>widget</i> = 0 ) <tt> (obsolete)</tt></td></tr> </table> <hr /> <h2>Property Documentation</h2> <a name="//apple_ref/cpp/instm/QGraphicsScene/isSortCacheEnabled"></a> <a name="//apple_ref/cpp/instm/QGraphicsScene/setSortCacheEnabled"></a> <h3 class="fn"><a name="sortCacheEnabled-prop"></a>sortCacheEnabled : bool</h3> <p>This property holds whether sort caching is enabled.</p> <p>Since Qt 4.6, this property has no effect.</p> <p>This property was introduced in Qt 4.5.</p> <p><b>Access functions:</b></p> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsscene.html#sortCacheEnabled-prop">isSortCacheEnabled</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsscene.html#sortCacheEnabled-prop">setSortCacheEnabled</a></b> ( bool <i>enabled</i> )</td></tr> </table> <hr /> <h2>Member Function Documentation</h2> <a name="//apple_ref/cpp/instm/QGraphicsScene/drawItems"></a> <h3 class="fn"><a name="drawItems"></a>void QGraphicsScene::drawItems ( <a href="qpainter.html">QPainter</a> * <i>painter</i>, int <i>numItems</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> *[] <i>items</i>, const <a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a>[] <i>options</i>, <a href="qwidget.html">QWidget</a> * <i>widget</i> = 0 ) <tt> [virtual protected]</tt></h3> <p>Paints the given <i>items</i> using the provided <i>painter</i>, after the background has been drawn, and before the foreground has been drawn. All painting is done in <i>scene</i> coordinates. Before drawing each item, the painter must be transformed using <a href="qgraphicsitem.html#sceneTransform">QGraphicsItem::sceneTransform</a>().</p> <p>The <i>options</i> parameter is the list of style option objects for each item in <i>items</i>. The <i>numItems</i> parameter is the number of items in <i>items</i> and options in <i>options</i>. The <i>widget</i> parameter is optional; if specified, it should point to the widget that is being painted on.</p> <p>The default implementation prepares the painter matrix, and calls <a href="qgraphicsitem.html#paint">QGraphicsItem::paint</a>() on all items. Reimplement this function to provide custom painting of all items for the scene; gaining complete control over how each item is drawn. In some cases this can increase drawing performance significantly.</p> <p>Example:</p> <pre> void CustomScene::drawItems(QPainter *painter, int numItems, QGraphicsItem *items[], const QStyleOptionGraphicsItem options[], QWidget *widget) { for (int i = 0; i < numItems; ++i) { <span class="comment">// Draw the item</span> painter->save(); painter->setMatrix(items[i]->sceneMatrix(), true); items[i]->paint(painter, &options[i], widget); painter->restore(); } }</pre> <p>Since Qt 4.6, this function is not called anymore unless the <a href="qgraphicsview.html#OptimizationFlag-enum">QGraphicsView::IndirectPainting</a> flag is given as an Optimization flag.</p> <p>See also <a href="qgraphicsscene.html#drawBackground">drawBackground</a>() and <a href="qgraphicsscene.html#drawForeground">drawForeground</a>().</p> <h3 class="fn"><a name="itemAt-2"></a><a href="qgraphicsitem.html">QGraphicsItem</a> * QGraphicsScene::itemAt ( const <a href="qpointf.html">QPointF</a> & <i>position</i> ) const</h3> <p>This is an overloaded function.</p> <p>Returns the topmost visible item at the specified <i>position</i>, or 0 if there are no items at this position.</p> <p>This function is deprecated and returns incorrect results if the scene contains items that ignore transformations. Use the overload that takes a <a href="qtransform.html">QTransform</a> instead.</p> <p>See also <a href="qgraphicsscene.html#items">items</a>(), <a href="qgraphicsscene.html#collidingItems">collidingItems</a>(), and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p> <h3 class="fn"><a name="itemAt-4"></a><a href="qgraphicsitem.html">QGraphicsItem</a> * QGraphicsScene::itemAt ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>x</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>y</i> ) const</h3> <p>This is an overloaded function.</p> <p>Returns the topmost item at the position specified by (<i>x</i>, <i>y</i>), or 0 if there are no items at this position.</p> <p>This convenience function is equivalent to calling <tt>itemAt(QPointF(x, y))</tt>.</p> <p>This function is deprecated and returns incorrect results if the scene contains items that ignore transformations. Use the overload that takes a <a href="qtransform.html">QTransform</a> instead.</p> <h3 class="fn"><a name="items-4"></a><a href="qlist.html">QList</a><<a href="qgraphicsitem.html">QGraphicsItem</a> *> QGraphicsScene::items ( const <a href="qpointf.html">QPointF</a> & <i>pos</i> ) const</h3> <p>Returns all visible items at position <i>pos</i> in the scene. The items are listed in descending stacking order (i.e., the first item in the list is the top-most item, and the last item is the bottom-most item).</p> <p>This function is deprecated and returns incorrect results if the scene contains items that ignore transformations. Use the overload that takes a <a href="qtransform.html">QTransform</a> instead.</p> <p>See also <a href="qgraphicsscene.html#itemAt">itemAt</a>() and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p> <h3 class="fn"><a name="items-5"></a><a href="qlist.html">QList</a><<a href="qgraphicsitem.html">QGraphicsItem</a> *> QGraphicsScene::items ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>x</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>y</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>w</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>h</i>, <a href="qt.html#ItemSelectionMode-enum">Qt::ItemSelectionMode</a> <i>mode</i> = Qt::IntersectsItemShape ) const</h3> <p>This convenience function is equivalent to calling items(<a href="qrectf.html">QRectF</a>(<i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>), <i>mode</i>).</p> <p>This function is deprecated and returns incorrect results if the scene contains items that ignore transformations. Use the overload that takes a <a href="qtransform.html">QTransform</a> instead.</p> <p>This function was introduced in Qt 4.3.</p> <h3 class="fn"><a name="items-6"></a><a href="qlist.html">QList</a><<a href="qgraphicsitem.html">QGraphicsItem</a> *> QGraphicsScene::items ( const <a href="qrectf.html">QRectF</a> & <i>rectangle</i>, <a href="qt.html#ItemSelectionMode-enum">Qt::ItemSelectionMode</a> <i>mode</i> = Qt::IntersectsItemShape ) 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>rectangle</i>.</p> <p>The default value for <i>mode</i> is <a href="qt.html#ItemSelectionMode-enum">Qt::IntersectsItemShape</a>; all items whose exact shape intersects with or is contained by <i>rectangle</i> are returned.</p> <p>This function is deprecated and returns incorrect results if the scene contains items that ignore transformations. Use the overload that takes a <a href="qtransform.html">QTransform</a> instead.</p> <p>See also <a href="qgraphicsscene.html#itemAt">itemAt</a>() and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p> <h3 class="fn"><a name="items-8"></a><a href="qlist.html">QList</a><<a href="qgraphicsitem.html">QGraphicsItem</a> *> QGraphicsScene::items ( const <a href="qpolygonf.html">QPolygonF</a> & <i>polygon</i>, <a href="qt.html#ItemSelectionMode-enum">Qt::ItemSelectionMode</a> <i>mode</i> = Qt::IntersectsItemShape ) 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 polygon <i>polygon</i>.</p> <p>The default value for <i>mode</i> is <a href="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>This function is deprecated and returns incorrect results if the scene contains items that ignore transformations. Use the overload that takes a <a href="qtransform.html">QTransform</a> instead.</p> <p>See also <a href="qgraphicsscene.html#itemAt">itemAt</a>() and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p> <h3 class="fn"><a name="items-9"></a><a href="qlist.html">QList</a><<a href="qgraphicsitem.html">QGraphicsItem</a> *> QGraphicsScene::items ( const <a href="qpainterpath.html">QPainterPath</a> & <i>path</i>, <a href="qt.html#ItemSelectionMode-enum">Qt::ItemSelectionMode</a> <i>mode</i> = Qt::IntersectsItemShape ) const</h3> <p>This is an overloaded function.</p> <p>Returns all visible items that, depending on <i>path</i>, are either inside or intersect with the path <i>path</i>.</p> <p>The default value for <i>mode</i> is <a href="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>This function is deprecated and returns incorrect results if the scene contains items that ignore transformations. Use the overload that takes a <a href="qtransform.html">QTransform</a> instead.</p> <p>See also <a href="qgraphicsscene.html#itemAt">itemAt</a>() and <a href="qgraphicsitem.html#sorting">Sorting</a>.</p> <h3 class="fn"><a name="setSelectionArea-2"></a>void QGraphicsScene::setSelectionArea ( const <a href="qpainterpath.html">QPainterPath</a> & <i>path</i> )</h3> <p>This is an overloaded function.</p> <p>Sets the selection area to <i>path</i>.</p> <p>This function is deprecated and leads to incorrect results if the scene contains items that ignore transformations. Use the overload that takes a <a href="qtransform.html">QTransform</a> instead.</p> <h3 class="fn"><a name="setSelectionArea-3"></a>void QGraphicsScene::setSelectionArea ( const <a href="qpainterpath.html">QPainterPath</a> & <i>path</i>, <a href="qt.html#ItemSelectionMode-enum">Qt::ItemSelectionMode</a> <i>mode</i> )</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>This function was introduced in Qt 4.3.</p> <p>See also <a href="qgraphicsscene.html#clearSelection">clearSelection</a>() and <a href="qgraphicsscene.html#selectionArea">selectionArea</a>().</p> <p /><address><hr /><div align="center"> <table width="100%" cellspacing="0" border="0"><tr class="address"> <td width="40%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td> <td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td> <td width="40%" align="right"><div align="right">Qt 4.6.3</div></td> </tr></table></div></address></body> </html>