Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 3f684444755c5ad1181cdd5a97348f3c > files > 1198

PyQt4-devel-4.7.4-2.fc14.i686.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QGraphicsRectItem Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QGraphicsRectItem Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QGraphicsRectItem class provides a rectangle item that you can add to a <a href="qgraphicsscene.html">QGraphicsScene</a>. <a href="#details">More...</a></p>
<p>Inherits <a href="qabstractgraphicsshapeitem.html">QAbstractGraphicsShapeItem</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qgraphicsrectitem.html#QGraphicsRectItem">__init__</a></b> (<i>self</i>, QGraphicsItem&#160;<i>parent</i>&#160;=&#160;None, QGraphicsScene&#160;<i>scene</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qgraphicsrectitem.html#QGraphicsRectItem-2">__init__</a></b> (<i>self</i>, QRectF, QGraphicsItem&#160;<i>parent</i>&#160;=&#160;None, QGraphicsScene&#160;<i>scene</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qgraphicsrectitem.html#QGraphicsRectItem-3">__init__</a></b> (<i>self</i>, float, float, float, float, QGraphicsItem&#160;<i>parent</i>&#160;=&#160;None, QGraphicsScene&#160;<i>scene</i>&#160;=&#160;None)</li><li><div class="fn" />QRectF <b><a href="qgraphicsrectitem.html#boundingRect">boundingRect</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicsrectitem.html#contains">contains</a></b> (<i>self</i>, QPointF)</li><li><div class="fn" />bool <b><a href="qgraphicsrectitem.html#isObscuredBy">isObscuredBy</a></b> (<i>self</i>, QGraphicsItem)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsrectitem.html#opaqueArea">opaqueArea</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsrectitem.html#paint">paint</a></b> (<i>self</i>, QPainter, QStyleOptionGraphicsItem, QWidget&#160;<i>widget</i>&#160;=&#160;None)</li><li><div class="fn" />QRectF <b><a href="qgraphicsrectitem.html#rect">rect</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsrectitem.html#setRect">setRect</a></b> (<i>self</i>, QRectF)</li><li><div class="fn" /><b><a href="qgraphicsrectitem.html#setRect-2">setRect</a></b> (<i>self</i>, float, float, float, float)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicsrectitem.html#shape">shape</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qgraphicsrectitem.html#type">type</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QGraphicsRectItem class provides a rectangle item that you can add to a <a href="qgraphicsscene.html">QGraphicsScene</a>.</p>
<p>To set the item's rectangle, pass a <a href="qrectf.html">QRectF</a> to QGraphicsRectItem's constructor, or call the <a href="qgraphicsrectitem.html#setRect">setRect</a>() function. The <a href="qgraphicsrectitem.html#rect">rect</a>() function returns the current rectangle.</p>
<p align="center"><img src="images/graphicsview-rectitem.png" /></p><p>QGraphicsRectItem uses the rectangle and the pen width to provide a reasonable implementation of <a href="qgraphicsrectitem.html#boundingRect">boundingRect</a>(), <a href="qgraphicsrectitem.html#shape">shape</a>(), and <a href="qgraphicsrectitem.html#contains">contains</a>(). The <a href="qgraphicsrectitem.html#paint">paint</a>() function draws the rectangle using the item's associated pen and brush, which you can set by calling the <a href="qabstractgraphicsshapeitem.html#setPen">setPen</a>() and <a href="qabstractgraphicsshapeitem.html#setBrush">setBrush</a>() functions.</p>
<p><b>Note:</b> The rendering of invalid rectangles, such as those with negative widths or heights, is undefined. If you cannot be sure that you are using valid rectangles (for example, if you are creating rectangles using data from an unreliable source) then you should use <a href="qrectf.html#normalized">QRectF.normalized</a>() to create normalized rectangles, and use those instead.</p>
<p>See also <a href="qgraphicspathitem.html">QGraphicsPathItem</a>, <a href="qgraphicsellipseitem.html">QGraphicsEllipseItem</a>, <a href="qgraphicspolygonitem.html">QGraphicsPolygonItem</a>, <a href="qgraphicstextitem.html">QGraphicsTextItem</a>, <a href="qgraphicslineitem.html">QGraphicsLineItem</a>, <a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a>, and <a href="graphicsview.html">The Graphics View Framework</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QGraphicsRectItem" />QGraphicsRectItem.__init__ (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>parent</i>&#160;=&#160;None, <a href="qgraphicsscene.html">QGraphicsScene</a>&#160;<i>scene</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>The <i>scene</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a <a href="qgraphicsrectitem.html">QGraphicsRectItem</a>. <i>parent</i> is passed to <a href="qabstractgraphicsshapeitem.html">QAbstractGraphicsShapeItem</a>'s constructor.</p>
<p>See also <a href="qgraphicsscene.html#addItem">QGraphicsScene.addItem</a>().</p>
<h3 class="fn"><a name="QGraphicsRectItem-2" />QGraphicsRectItem.__init__ (<i>self</i>, <a href="qrectf.html">QRectF</a>, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>parent</i>&#160;=&#160;None, <a href="qgraphicsscene.html">QGraphicsScene</a>&#160;<i>scene</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>The <i>scene</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a <a href="qgraphicsrectitem.html">QGraphicsRectItem</a>, using <i>rect</i> as the default rectangle. <i>parent</i> is passed to <a href="qabstractgraphicsshapeitem.html">QAbstractGraphicsShapeItem</a>'s constructor.</p>
<p>See also <a href="qgraphicsscene.html#addItem">QGraphicsScene.addItem</a>().</p>
<h3 class="fn"><a name="QGraphicsRectItem-3" />QGraphicsRectItem.__init__ (<i>self</i>, float, float, float, float, <a href="qgraphicsitem.html">QGraphicsItem</a>&#160;<i>parent</i>&#160;=&#160;None, <a href="qgraphicsscene.html">QGraphicsScene</a>&#160;<i>scene</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>The <i>scene</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a <a href="qgraphicsrectitem.html">QGraphicsRectItem</a> with a default rectangle defined by (<i>x</i>, <i>y</i>) and the given <i>width</i> and <i>height</i>.</p>
<p><i>parent</i> is passed to <a href="qabstractgraphicsshapeitem.html">QAbstractGraphicsShapeItem</a>'s constructor.</p>
<p>See also <a href="qgraphicsscene.html#addItem">QGraphicsScene.addItem</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsRectItem/~QGraphicsRectItem" />
<h3 class="fn"><a name="boundingRect" /><a href="qrectf.html">QRectF</a> QGraphicsRectItem.boundingRect (<i>self</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#boundingRect">QGraphicsItem.boundingRect</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsRectItem/contains" />
<h3 class="fn"><a name="contains" />bool QGraphicsRectItem.contains (<i>self</i>, <a href="qpointf.html">QPointF</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#contains">QGraphicsItem.contains</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsRectItem/isObscuredBy" />
<h3 class="fn"><a name="isObscuredBy" />bool QGraphicsRectItem.isObscuredBy (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#isObscuredBy">QGraphicsItem.isObscuredBy</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsRectItem/opaqueArea" />
<h3 class="fn"><a name="opaqueArea" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsRectItem.opaqueArea (<i>self</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#opaqueArea">QGraphicsItem.opaqueArea</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsRectItem/paint" />
<h3 class="fn"><a name="paint" />QGraphicsRectItem.paint (<i>self</i>, <a href="qpainter.html">QPainter</a>, <a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a>, <a href="qwidget.html">QWidget</a>&#160;<i>widget</i>&#160;=&#160;None)</h3><p>Reimplemented from <a href="qgraphicsitem.html#paint">QGraphicsItem.paint</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsRectItem/rect" />
<h3 class="fn"><a name="rect" /><a href="qrectf.html">QRectF</a> QGraphicsRectItem.rect (<i>self</i>)</h3><p>Returns the item's rectangle.</p>
<p>See also <a href="qgraphicsrectitem.html#setRect">setRect</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsRectItem/setRect" />
<h3 class="fn"><a name="setRect" />QGraphicsRectItem.setRect (<i>self</i>, <a href="qrectf.html">QRectF</a>)</h3><p>Sets the item's rectangle to be the given <i>rectangle</i>.</p>
<p>See also <a href="qgraphicsrectitem.html#rect">rect</a>().</p>
<h3 class="fn"><a name="setRect-2" />QGraphicsRectItem.setRect (<i>self</i>, float, float, float, float)</h3><p>Sets the item's rectangle to the rectangle defined by (<i>x</i>, <i>y</i>) and the given <i>width</i> and <i>height</i>.</p>
<p>This convenience function is equivalent to calling <tt>setRect(QRectF(x, y, width, height))</tt></p>
<p>See also <a href="qgraphicsrectitem.html#rect">rect</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsRectItem/shape" />
<h3 class="fn"><a name="shape" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsRectItem.shape (<i>self</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#shape">QGraphicsItem.shape</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsRectItem/type" />
<h3 class="fn"><a name="type" />int QGraphicsRectItem.type (<i>self</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#type">QGraphicsItem.type</a>().</p>
<p /><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.4 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.3</td></tr></table></div></address></body></html>