Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 4191

qt4-doc-4.6.3-0.2mdv2010.2.i586.rpm

<?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">
<!-- qgraphicsitem.cpp -->
<head>
  <title>Qt 4.6: QGraphicsRectItem Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//QGraphicsRectItem"></a>
<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">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QGraphicsRectItem Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span>
</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>
<pre> #include &lt;QGraphicsRectItem&gt;</pre><p>Inherits <a href="qabstractgraphicsshapeitem.html">QAbstractGraphicsShapeItem</a>.</p>
<p>This class was introduced in Qt 4.2.</p>
<ul>
<li><a href="qgraphicsrectitem-members.html">List of all members, including inherited members</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsrectitem.html#QGraphicsRectItem">QGraphicsRectItem</a></b> ( QGraphicsItem * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsrectitem.html#QGraphicsRectItem-2">QGraphicsRectItem</a></b> ( const QRectF &amp; <i>rect</i>, QGraphicsItem * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsrectitem.html#QGraphicsRectItem-3">QGraphicsRectItem</a></b> ( qreal <i>x</i>, qreal <i>y</i>, qreal <i>width</i>, qreal <i>height</i>, QGraphicsItem * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsrectitem.html#dtor.QGraphicsRectItem">~QGraphicsRectItem</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QRectF </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsrectitem.html#rect">rect</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsrectitem.html#setRect">setRect</a></b> ( const QRectF &amp; <i>rectangle</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsrectitem.html#setRect-2">setRect</a></b> ( qreal <i>x</i>, qreal <i>y</i>, qreal <i>width</i>, qreal <i>height</i> )</td></tr>
</table>
<hr />
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual QRectF </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsrectitem.html#boundingRect">boundingRect</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsrectitem.html#contains">contains</a></b> ( const QPointF &amp; <i>point</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsrectitem.html#isObscuredBy">isObscuredBy</a></b> ( const QGraphicsItem * <i>item</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QPainterPath </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsrectitem.html#opaqueArea">opaqueArea</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsrectitem.html#paint">paint</a></b> ( QPainter * <i>painter</i>, const QStyleOptionGraphicsItem * <i>option</i>, QWidget * <i>widget</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QPainterPath </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsrectitem.html#shape">shape</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsrectitem.html#type">type</a></b> () const</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>6 public functions inherited from <a href="qabstractgraphicsshapeitem.html#public-functions">QAbstractGraphicsShapeItem</a></li>
<li><div bar="2" class="fn"></div>177 public functions inherited from <a href="qgraphicsitem.html#public-functions">QGraphicsItem</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>2 static public members inherited from <a href="qgraphicsitem.html#static-public-members">QGraphicsItem</a></li>
<li><div class="fn"></div>23 protected functions inherited from <a href="qgraphicsitem.html#protected-functions">QGraphicsItem</a></li>
</ul>
<a name="details"></a>
<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>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/QGraphicsRectItem/QGraphicsRectItem"></a>
<h3 class="fn"><a name="QGraphicsRectItem"></a>QGraphicsRectItem::QGraphicsRectItem ( <a href="qgraphicsitem.html">QGraphicsItem</a> * <i>parent</i> = 0 )</h3>
<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"></a>QGraphicsRectItem::QGraphicsRectItem ( const <a href="qrectf.html">QRectF</a> &amp; <i>rect</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> * <i>parent</i> = 0 )</h3>
<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"></a>QGraphicsRectItem::QGraphicsRectItem ( <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>width</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>height</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> * <i>parent</i> = 0 )</h3>
<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"></a>
<h3 class="fn"><a name="dtor.QGraphicsRectItem"></a>QGraphicsRectItem::~QGraphicsRectItem ()</h3>
<p>Destroys the <a href="qgraphicsrectitem.html">QGraphicsRectItem</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsRectItem/boundingRect"></a>
<h3 class="fn"><a name="boundingRect"></a><a href="qrectf.html">QRectF</a> QGraphicsRectItem::boundingRect () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#boundingRect">QGraphicsItem::boundingRect</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsRectItem/contains"></a>
<h3 class="fn"><a name="contains"></a>bool QGraphicsRectItem::contains ( const <a href="qpointf.html">QPointF</a> &amp; <i>point</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#contains">QGraphicsItem::contains</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsRectItem/isObscuredBy"></a>
<h3 class="fn"><a name="isObscuredBy"></a>bool QGraphicsRectItem::isObscuredBy ( const <a href="qgraphicsitem.html">QGraphicsItem</a> * <i>item</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#isObscuredBy">QGraphicsItem::isObscuredBy</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsRectItem/opaqueArea"></a>
<h3 class="fn"><a name="opaqueArea"></a><a href="qpainterpath.html">QPainterPath</a> QGraphicsRectItem::opaqueArea () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#opaqueArea">QGraphicsItem::opaqueArea</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsRectItem/paint"></a>
<h3 class="fn"><a name="paint"></a>void QGraphicsRectItem::paint ( <a href="qpainter.html">QPainter</a> * <i>painter</i>, const <a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a> * <i>option</i>, <a href="qwidget.html">QWidget</a> * <i>widget</i> = 0 )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#paint">QGraphicsItem::paint</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsRectItem/rect"></a>
<h3 class="fn"><a name="rect"></a><a href="qrectf.html">QRectF</a> QGraphicsRectItem::rect () const</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"></a>
<h3 class="fn"><a name="setRect"></a>void QGraphicsRectItem::setRect ( const <a href="qrectf.html">QRectF</a> &amp; <i>rectangle</i> )</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"></a>void QGraphicsRectItem::setRect ( <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>width</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>height</i> )</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"></a>
<h3 class="fn"><a name="shape"></a><a href="qpainterpath.html">QPainterPath</a> QGraphicsRectItem::shape () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#shape">QGraphicsItem::shape</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsRectItem/type"></a>
<h3 class="fn"><a name="type"></a>int QGraphicsRectItem::type () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#type">QGraphicsItem::type</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 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>