1
<?xml version="1.0" encoding="iso-8859-1"?>
3
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/corelib/tools/qrect.cpp -->
7
<title>Qt 4.0: QRect Class Reference</title>
8
<style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
9
a:link { color: #004faf; text-decoration: none }
10
a:visited { color: #672967; text-decoration: none }
11
td.postheader { font-family: sans-serif }
12
tr.address { font-family: sans-serif }
13
body { background: #ffffff; color: black; }</style>
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
19
<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="mainclasses.html"><font color="#004faf">Main Classes</font></a> · <a href="annotated.html"><font color="#004faf">Annotated</font></a> · <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> · <a href="functions.html"><font color="#004faf">Functions</font></a></td>
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">QRect Class Reference</h1>
21
<p>The QRect class defines a rectangle in the plane. <a href="#details">More...</a></p>
22
<pre>#include <QRect></pre><p>Part of the <a href="qtcore.html">QtCore</a> module.</p>
24
<li><a href="qrect-members.html">List of all members, including inherited members</a></li>
25
<li><a href="qrect-qt3.html">Qt 3 support members</a></li>
27
<a name="public-functions"></a>
28
<h3>Public Functions</h3>
30
<li><div class="fn"/><b><a href="qrect.html#QRect">QRect</a></b> ()</li>
31
<li><div class="fn"/><b><a href="qrect.html#QRect-2">QRect</a></b> ( const QPoint & <i>topLeft</i>, const QPoint & <i>bottomRight</i> )</li>
32
<li><div class="fn"/><b><a href="qrect.html#QRect-3">QRect</a></b> ( const QPoint & <i>topLeft</i>, const QSize & <i>size</i> )</li>
33
<li><div class="fn"/><b><a href="qrect.html#QRect-4">QRect</a></b> ( int <i>left</i>, int <i>top</i>, int <i>width</i>, int <i>height</i> )</li>
34
<li><div class="fn"/>void <b><a href="qrect.html#adjust">adjust</a></b> ( int <i>xp1</i>, int <i>yp1</i>, int <i>xp2</i>, int <i>yp2</i> )</li>
35
<li><div class="fn"/>QRect <b><a href="qrect.html#adjusted">adjusted</a></b> ( int <i>xp1</i>, int <i>yp1</i>, int <i>xp2</i>, int <i>yp2</i> ) const</li>
36
<li><div class="fn"/>int <b><a href="qrect.html#bottom">bottom</a></b> () const</li>
37
<li><div class="fn"/>QPoint <b><a href="qrect.html#bottomLeft">bottomLeft</a></b> () const</li>
38
<li><div class="fn"/>QPoint <b><a href="qrect.html#bottomRight">bottomRight</a></b> () const</li>
39
<li><div class="fn"/>QPoint <b><a href="qrect.html#center">center</a></b> () const</li>
40
<li><div class="fn"/>bool <b><a href="qrect.html#contains">contains</a></b> ( const QPoint & <i>p</i>, bool <i>proper</i> = false ) const</li>
41
<li><div class="fn"/>bool <b><a href="qrect.html#contains-2">contains</a></b> ( int <i>x</i>, int <i>y</i>, bool <i>proper</i> ) const</li>
42
<li><div class="fn"/>bool <b><a href="qrect.html#contains-3">contains</a></b> ( int <i>x</i>, int <i>y</i> ) const</li>
43
<li><div class="fn"/>bool <b><a href="qrect.html#contains-4">contains</a></b> ( const QRect & <i>r</i>, bool <i>proper</i> = false ) const</li>
44
<li><div class="fn"/>void <b><a href="qrect.html#getCoords">getCoords</a></b> ( int * <i>xp1</i>, int * <i>yp1</i>, int * <i>xp2</i>, int * <i>yp2</i> ) const</li>
45
<li><div class="fn"/>void <b><a href="qrect.html#getRect">getRect</a></b> ( int * <i>x</i>, int * <i>y</i>, int * <i>w</i>, int * <i>h</i> ) const</li>
46
<li><div class="fn"/>int <b><a href="qrect.html#height">height</a></b> () const</li>
47
<li><div class="fn"/>QRect <b><a href="qrect.html#intersect">intersect</a></b> ( const QRect & <i>r</i> ) const</li>
48
<li><div class="fn"/>bool <b><a href="qrect.html#intersects">intersects</a></b> ( const QRect & <i>r</i> ) const</li>
49
<li><div class="fn"/>bool <b><a href="qrect.html#isEmpty">isEmpty</a></b> () const</li>
50
<li><div class="fn"/>bool <b><a href="qrect.html#isNull">isNull</a></b> () const</li>
51
<li><div class="fn"/>bool <b><a href="qrect.html#isValid">isValid</a></b> () const</li>
52
<li><div class="fn"/>int <b><a href="qrect.html#left">left</a></b> () const</li>
53
<li><div class="fn"/>void <b><a href="qrect.html#moveBottom">moveBottom</a></b> ( int <i>pos</i> )</li>
54
<li><div class="fn"/>void <b><a href="qrect.html#moveBottomLeft">moveBottomLeft</a></b> ( const QPoint & <i>p</i> )</li>
55
<li><div class="fn"/>void <b><a href="qrect.html#moveBottomRight">moveBottomRight</a></b> ( const QPoint & <i>p</i> )</li>
56
<li><div class="fn"/>void <b><a href="qrect.html#moveCenter">moveCenter</a></b> ( const QPoint & <i>p</i> )</li>
57
<li><div class="fn"/>void <b><a href="qrect.html#moveLeft">moveLeft</a></b> ( int <i>pos</i> )</li>
58
<li><div class="fn"/>void <b><a href="qrect.html#moveRight">moveRight</a></b> ( int <i>pos</i> )</li>
59
<li><div class="fn"/>void <b><a href="qrect.html#moveTo">moveTo</a></b> ( int <i>x</i>, int <i>y</i> )</li>
60
<li><div class="fn"/>void <b><a href="qrect.html#moveTo-2">moveTo</a></b> ( const QPoint & <i>pt</i> )</li>
61
<li><div class="fn"/>void <b><a href="qrect.html#moveTop">moveTop</a></b> ( int <i>pos</i> )</li>
62
<li><div class="fn"/>void <b><a href="qrect.html#moveTopLeft">moveTopLeft</a></b> ( const QPoint & <i>p</i> )</li>
63
<li><div class="fn"/>void <b><a href="qrect.html#moveTopRight">moveTopRight</a></b> ( const QPoint & <i>p</i> )</li>
64
<li><div class="fn"/>QRect <b><a href="qrect.html#normalized">normalized</a></b> () const</li>
65
<li><div class="fn"/>int <b><a href="qrect.html#right">right</a></b> () const</li>
66
<li><div class="fn"/>void <b><a href="qrect.html#setBottom">setBottom</a></b> ( int <i>pos</i> )</li>
67
<li><div class="fn"/>void <b><a href="qrect.html#setBottomLeft">setBottomLeft</a></b> ( const QPoint & <i>p</i> )</li>
68
<li><div class="fn"/>void <b><a href="qrect.html#setBottomRight">setBottomRight</a></b> ( const QPoint & <i>p</i> )</li>
69
<li><div class="fn"/>void <b><a href="qrect.html#setCoords">setCoords</a></b> ( int <i>xp1</i>, int <i>yp1</i>, int <i>xp2</i>, int <i>yp2</i> )</li>
70
<li><div class="fn"/>void <b><a href="qrect.html#setHeight">setHeight</a></b> ( int <i>h</i> )</li>
71
<li><div class="fn"/>void <b><a href="qrect.html#setLeft">setLeft</a></b> ( int <i>pos</i> )</li>
72
<li><div class="fn"/>void <b><a href="qrect.html#setRect">setRect</a></b> ( int <i>x</i>, int <i>y</i>, int <i>w</i>, int <i>h</i> )</li>
73
<li><div class="fn"/>void <b><a href="qrect.html#setRight">setRight</a></b> ( int <i>pos</i> )</li>
74
<li><div class="fn"/>void <b><a href="qrect.html#setSize">setSize</a></b> ( const QSize & <i>s</i> )</li>
75
<li><div class="fn"/>void <b><a href="qrect.html#setTop">setTop</a></b> ( int <i>pos</i> )</li>
76
<li><div class="fn"/>void <b><a href="qrect.html#setTopLeft">setTopLeft</a></b> ( const QPoint & <i>p</i> )</li>
77
<li><div class="fn"/>void <b><a href="qrect.html#setTopRight">setTopRight</a></b> ( const QPoint & <i>p</i> )</li>
78
<li><div class="fn"/>void <b><a href="qrect.html#setWidth">setWidth</a></b> ( int <i>w</i> )</li>
79
<li><div class="fn"/>void <b><a href="qrect.html#setX">setX</a></b> ( int <i>x</i> )</li>
80
<li><div class="fn"/>void <b><a href="qrect.html#setY">setY</a></b> ( int <i>y</i> )</li>
81
<li><div class="fn"/>QSize <b><a href="qrect.html#size">size</a></b> () const</li>
82
<li><div class="fn"/>int <b><a href="qrect.html#top">top</a></b> () const</li>
83
<li><div class="fn"/>QPoint <b><a href="qrect.html#topLeft">topLeft</a></b> () const</li>
84
<li><div class="fn"/>QPoint <b><a href="qrect.html#topRight">topRight</a></b> () const</li>
85
<li><div class="fn"/>void <b><a href="qrect.html#translate">translate</a></b> ( int <i>dx</i>, int <i>dy</i> )</li>
86
<li><div class="fn"/>void <b><a href="qrect.html#translate-2">translate</a></b> ( const QPoint & <i>p</i> )</li>
87
<li><div class="fn"/>QRect <b><a href="qrect.html#translated">translated</a></b> ( int <i>dx</i>, int <i>dy</i> ) const</li>
88
<li><div class="fn"/>QRect <b><a href="qrect.html#translated-2">translated</a></b> ( const QPoint & <i>p</i> ) const</li>
89
<li><div class="fn"/>QRect <b><a href="qrect.html#unite">unite</a></b> ( const QRect & <i>r</i> ) const</li>
90
<li><div class="fn"/>int <b><a href="qrect.html#width">width</a></b> () const</li>
91
<li><div class="fn"/>int <b><a href="qrect.html#x">x</a></b> () const</li>
92
<li><div class="fn"/>int <b><a href="qrect.html#y">y</a></b> () const</li>
93
<li><div class="fn"/>QRect <b><a href="qrect.html#operator-and">operator&</a></b> ( const QRect & <i>r</i> ) const</li>
94
<li><div class="fn"/>QRect & <b><a href="qrect.html#operator-and-eq">operator&=</a></b> ( const QRect & <i>r</i> )</li>
95
<li><div class="fn"/>QRect <b><a href="qrect.html#operator-7c">operator|</a></b> ( const QRect & <i>r</i> ) const</li>
96
<li><div class="fn"/>QRect & <b><a href="qrect.html#operator-7c-eq">operator|=</a></b> ( const QRect & <i>r</i> )</li>
98
<a name="related-non-members"></a>
99
<h3>Related Non-Members</h3>
101
<li><div class="fn"/>bool <b><a href="qrect.html#operator-not-eq-14">operator!=</a></b> ( const QRect & <i>r1</i>, const QRect & <i>r2</i> )</li>
102
<li><div class="fn"/>QDataStream & <b><a href="qrect.html#operator-lt-lt-44">operator<<</a></b> ( QDataStream & <i>stream</i>, const QRect & <i>rectangle</i> )</li>
103
<li><div class="fn"/>bool <b><a href="qrect.html#operator-eq-eq-21">operator==</a></b> ( const QRect & <i>r1</i>, const QRect & <i>r2</i> )</li>
104
<li><div class="fn"/>QDataStream & <b><a href="qrect.html#operator-gt-gt-29">operator>></a></b> ( QDataStream & <i>stream</i>, QRect & <i>rectangle</i> )</li>
106
<a name="details"></a>
108
<h2>Detailed Description</h2>
109
<p>The QRect class defines a rectangle in the plane.</p>
110
<p>A rectangle is internally represented as an upper-left corner and a bottom-right corner, but it is normally expressed as an upper-left corner and a size.</p>
111
<p>Note that the size (width and height) of a rectangle might be different from what you are used to. If the top-left corner and the bottom-right corner are the same, the height and the width of the rectangle will both be 1.</p>
112
<p>Generally, <i>width = right - left + 1</i> and <i>height = bottom - top + 1</i>. We designed it this way to make it correspond to rectangular spaces used by drawing functions in which the width and height denote a number of pixels. For example, drawing a rectangle with width and height 1 draws a single pixel.</p>
113
<p>The default coordinate system has origin (0, 0) in the top-left corner. The positive direction of the y axis is down, and the positive x axis is from left to right.</p>
114
<p>A QRect can be constructed with a set of left, top, width and height integers, from two <a href="qpoint.html">QPoint</a>s or from a <a href="qpoint.html">QPoint</a> and a <a href="qsize.html">QSize</a>. The following code creates three identical triangles.</p>
115
<pre> QRect r1(QPoint(100,200), QPoint(110,215));
116
QRect r2(QPoint(100,200), QSize(11,16));
117
QRect r3(100, 200, 11, 16);</pre>
118
<p>After creation the dimensions can be changed, e.g. with <a href="qrect.html#setLeft">setLeft</a>(), <a href="qrect.html#setRight">setRight</a>(), <a href="qrect.html#setTop">setTop</a>() and <a href="qrect.html#setBottom">setBottom</a>(), or by setting sizes, e.g. <a href="qrect.html#setWidth">setWidth</a>(), <a href="qrect.html#setHeight">setHeight</a>() and <a href="qrect.html#setSize">setSize</a>(). The dimensions can also be changed with the move functions, e.g. <a href="qrect.html#translate">translate</a>(), <a href="qrect.html#moveCenter">moveCenter</a>(), <a href="qrect.html#moveBottomRight">moveBottomRight</a>(), etc. You can also add coordinates to a rectangle with <a href="qrect.html#adjust">adjust</a>(). You can get a new rectangle based on adjustments from the original rectangled with <a href="qrect.html#adjusted">adjusted</a>().</p>
119
<p>You can test to see if a QRect contains a specific point with <a href="qrect.html#contains">contains</a>(). You can also test to see if two QRects intersect with <a href="qrect.html#intersects">intersects</a>() (see also <a href="qrect.html#intersect">intersect</a>()). To get the bounding rectangle of two QRects use <a href="qrect.html#unite">unite</a>().</p>
120
<p>See also <a href="qpoint.html">QPoint</a>, <a href="qsize.html">QSize</a>, <a href="qpolygon.html">QPolygon</a>, and <a href="qrectf.html">QRectF</a>.</p>
122
<h2>Member Function Documentation</h2>
123
<h3 class="fn"><a name="QRect"></a>QRect::QRect ()</h3>
124
<p>Constructs a null rectangle.</p>
125
<p>See also <a href="qrect.html#isNull">isNull</a>().</p>
126
<h3 class="fn"><a name="QRect-2"></a>QRect::QRect ( const <a href="qpoint.html">QPoint</a> & <i>topLeft</i>, const <a href="qpoint.html">QPoint</a> & <i>bottomRight</i> )</h3>
127
<p>Constructs a rectangle with <i>topLeft</i> as the top-left corner and <i>bottomRight</i> as the bottom-right corner.</p>
128
<h3 class="fn"><a name="QRect-3"></a>QRect::QRect ( const <a href="qpoint.html">QPoint</a> & <i>topLeft</i>, const <a href="qsize.html">QSize</a> & <i>size</i> )</h3>
129
<p>Constructs a rectangle with <i>topLeft</i> as the top-left corner and <i>size</i> as the rectangle size.</p>
130
<h3 class="fn"><a name="QRect-4"></a>QRect::QRect ( int <i>left</i>, int <i>top</i>, int <i>width</i>, int <i>height</i> )</h3>
131
<p>Constructs a rectangle with the <i>top</i>, <i>left</i> corner and <i>width</i> and <i>height</i>.</p>
132
<h3 class="fn"><a name="adjust"></a>void QRect::adjust ( int <i>xp1</i>, int <i>yp1</i>, int <i>xp2</i>, int <i>yp2</i> )</h3>
133
<p>Adds <i>xp1</i>, <i>yp1</i>, <i>xp2</i> and <i>yp2</i> respectively to the existing coordinates of the rectangle.</p>
134
<p>See also <a href="qrect.html#adjusted">adjusted</a>().</p>
135
<h3 class="fn"><a name="adjusted"></a>QRect QRect::adjusted ( int <i>xp1</i>, int <i>yp1</i>, int <i>xp2</i>, int <i>yp2</i> ) const</h3>
136
<p>Returns a new rectangle with <i>xp1</i>, <i>yp1</i>, <i>xp2</i> and <i>yp2</i> added to the existing coordinates of this rectangle.</p>
137
<p>See also <a href="qrect.html#adjust">adjust</a>().</p>
138
<h3 class="fn"><a name="bottom"></a>int QRect::bottom () const</h3>
139
<p>Returns the bottom coordinate of the rectangle.</p>
140
<p>See also <a href="qrect.html#setBottom">setBottom</a>(), <a href="qrect.html#top">top</a>(), <a href="qrect.html#bottomLeft">bottomLeft</a>(), and <a href="qrect.html#bottomRight">bottomRight</a>().</p>
141
<h3 class="fn"><a name="bottomLeft"></a><a href="qpoint.html">QPoint</a> QRect::bottomLeft () const</h3>
142
<p>Returns the bottom-left position of the rectangle.</p>
143
<p>See also <a href="qrect.html#setBottomLeft">setBottomLeft</a>(), <a href="qrect.html#moveBottomLeft">moveBottomLeft</a>(), <a href="qrect.html#topRight">topRight</a>(), <a href="qrect.html#bottom">bottom</a>(), and <a href="qrect.html#left">left</a>().</p>
144
<h3 class="fn"><a name="bottomRight"></a><a href="qpoint.html">QPoint</a> QRect::bottomRight () const</h3>
145
<p>Returns the bottom-right position of the rectangle.</p>
146
<p>See also <a href="qrect.html#setBottomRight">setBottomRight</a>(), <a href="qrect.html#moveBottomRight">moveBottomRight</a>(), <a href="qrect.html#topLeft">topLeft</a>(), <a href="qrect.html#right">right</a>(), and <a href="qrect.html#bottom">bottom</a>().</p>
147
<h3 class="fn"><a name="center"></a><a href="qpoint.html">QPoint</a> QRect::center () const</h3>
148
<p>Returns the center point of the rectangle.</p>
149
<p>See also <a href="qrect.html#moveCenter">moveCenter</a>(), <a href="qrect.html#topLeft">topLeft</a>(), <a href="qrect.html#bottomRight">bottomRight</a>(), <a href="qrect.html#topRight">topRight</a>(), and <a href="qrect.html#bottomLeft">bottomLeft</a>().</p>
150
<h3 class="fn"><a name="contains"></a>bool QRect::contains ( const <a href="qpoint.html">QPoint</a> & <i>p</i>, bool <i>proper</i> = false ) const</h3>
151
<p>Returns true if the point <i>p</i> is inside or on the edge of the rectangle; otherwise returns false.</p>
152
<p>If <i>proper</i> is true, this function returns true only if <i>p</i> is inside (not on the edge).</p>
153
<h3 class="fn"><a name="contains-2"></a>bool QRect::contains ( int <i>x</i>, int <i>y</i>, bool <i>proper</i> ) const</h3>
154
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
155
<p>Returns true if the point <i>x</i>, <i>y</i> is inside this rectangle; otherwise returns false.</p>
156
<p>If <i>proper</i> is true, this function returns true only if the point is entirely inside (not on the edge).</p>
157
<h3 class="fn"><a name="contains-3"></a>bool QRect::contains ( int <i>x</i>, int <i>y</i> ) const</h3>
158
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
159
<p>Returns true if the point <i>x</i>, <i>y</i> is inside this rectangle; otherwise returns false.</p>
160
<h3 class="fn"><a name="contains-4"></a>bool QRect::contains ( const QRect & <i>r</i>, bool <i>proper</i> = false ) const</h3>
161
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
162
<p>Returns true if the rectangle <i>r</i> is inside this rectangle; otherwise returns false.</p>
163
<p>If <i>proper</i> is true, this function returns true only if <i>r</i> is entirely inside (not on the edge).</p>
164
<p>See also <a href="qrect.html#unite">unite</a>(), <a href="qrect.html#intersect">intersect</a>(), and <a href="qrect.html#intersects">intersects</a>().</p>
165
<h3 class="fn"><a name="getCoords"></a>void QRect::getCoords ( int * <i>xp1</i>, int * <i>yp1</i>, int * <i>xp2</i>, int * <i>yp2</i> ) const</h3>
166
<p>Extracts the rectangle parameters as the top-left point <tt>*</tt><i>xp1</i>, <tt>*</tt><i>yp1</i> and the bottom-right point <tt>*</tt><i>xp2</i>, <tt>*</tt><i>yp2</i>.</p>
167
<p>See also <a href="qrect.html#setCoords">setCoords</a>() and <a href="qrect.html#getRect">getRect</a>().</p>
168
<h3 class="fn"><a name="getRect"></a>void QRect::getRect ( int * <i>x</i>, int * <i>y</i>, int * <i>w</i>, int * <i>h</i> ) const</h3>
169
<p>Extracts the rectangle parameters as the position <tt>*</tt><i>x</i>, <tt>*</tt><i>y</i> and width <tt>*</tt><i>w</i> and height <tt>*</tt><i>h</i>.</p>
170
<p>See also <a href="qrect.html#setRect">setRect</a>() and <a href="qrect.html#getCoords">getCoords</a>().</p>
171
<h3 class="fn"><a name="height"></a>int QRect::height () const</h3>
172
<p>Returns the height of the rectangle. The height includes both the top and bottom edges, i.e. height = bottom - top + 1.</p>
173
<p>See also <a href="qrect.html#width">width</a>(), <a href="qrect.html#size">size</a>(), and <a href="qrect.html#setHeight">setHeight</a>().</p>
174
<h3 class="fn"><a name="intersect"></a>QRect QRect::intersect ( const QRect & <i>r</i> ) const</h3>
175
<p>Returns the intersection of this rectangle and rectangle <i>r</i>. <tt>r.intersect(s)</tt> is equivalent to <tt>r&s</tt>.</p>
176
<h3 class="fn"><a name="intersects"></a>bool QRect::intersects ( const QRect & <i>r</i> ) const</h3>
177
<p>Returns true if this rectangle intersects with rectangle <i>r</i> (there is at least one pixel that is within both rectangles); otherwise returns false.</p>
178
<p>See also <a href="qrect.html#intersect">intersect</a>() and <a href="qrect.html#contains">contains</a>().</p>
179
<h3 class="fn"><a name="isEmpty"></a>bool QRect::isEmpty () const</h3>
180
<p>Returns true if the rectangle is empty; otherwise returns false.</p>
181
<p>An empty rectangle has a <a href="qrect.html#left">left</a>() > <a href="qrect.html#right">right</a>() or <a href="qrect.html#top">top</a>() > <a href="qrect.html#bottom">bottom</a>().</p>
182
<p>An empty rectangle is not valid. <tt>isEmpty() == !isValid()</tt></p>
183
<p>See also <a href="qrect.html#isNull">isNull</a>(), <a href="qrect.html#isValid">isValid</a>(), and <a href="qrect.html#normalized">normalized</a>().</p>
184
<h3 class="fn"><a name="isNull"></a>bool QRect::isNull () const</h3>
185
<p>Returns true if the rectangle is a null rectangle; otherwise returns false.</p>
186
<p>A null rectangle has both the width and the height set to 0, that is <a href="qrect.html#right">right</a>() == <a href="qrect.html#left">left</a>() - 1 and <a href="qrect.html#bottom">bottom</a>() == <a href="qrect.html#top">top</a>() - 1.</p>
187
<p>Note that if <a href="qrect.html#right">right</a>() == <a href="qrect.html#left">left</a>() and <a href="qrect.html#bottom">bottom</a>() == <a href="qrect.html#top">top</a>(), then the rectangle has width 1 and height 1.</p>
188
<p>A null rectangle is also empty.</p>
189
<p>A null rectangle is not valid.</p>
190
<p>See also <a href="qrect.html#isEmpty">isEmpty</a>() and <a href="qrect.html#isValid">isValid</a>().</p>
191
<h3 class="fn"><a name="isValid"></a>bool QRect::isValid () const</h3>
192
<p>Returns true if the rectangle is valid; otherwise returns false.</p>
193
<p>A valid rectangle has a <a href="qrect.html#left">left</a>() <= <a href="qrect.html#right">right</a>() and <a href="qrect.html#top">top</a>() <= <a href="qrect.html#bottom">bottom</a>().</p>
194
<p>Note that non-trivial operations like intersections are not defined for invalid rectangles.</p>
195
<p><tt>isValid() == !isEmpty()</tt></p>
196
<p>See also <a href="qrect.html#isNull">isNull</a>(), <a href="qrect.html#isEmpty">isEmpty</a>(), and <a href="qrect.html#normalized">normalized</a>().</p>
197
<h3 class="fn"><a name="left"></a>int QRect::left () const</h3>
198
<p>Returns the left coordinate of the rectangle. Identical to <a href="qrect.html#x">x</a>().</p>
199
<p>See also <a href="qrect.html#setLeft">setLeft</a>(), <a href="qrect.html#right">right</a>(), <a href="qrect.html#topLeft">topLeft</a>(), and <a href="qrect.html#bottomLeft">bottomLeft</a>().</p>
200
<h3 class="fn"><a name="moveBottom"></a>void QRect::moveBottom ( int <i>pos</i> )</h3>
201
<p>Sets the bottom position of the rectangle to <i>pos</i>, leaving the size unchanged.</p>
202
<p>See also <a href="qrect.html#bottom">bottom</a>(), <a href="qrect.html#setBottom">setBottom</a>(), <a href="qrect.html#moveLeft">moveLeft</a>(), <a href="qrect.html#moveTop">moveTop</a>(), and <a href="qrect.html#moveRight">moveRight</a>().</p>
203
<h3 class="fn"><a name="moveBottomLeft"></a>void QRect::moveBottomLeft ( const <a href="qpoint.html">QPoint</a> & <i>p</i> )</h3>
204
<p>Sets the bottom-left position of the rectangle to <i>p</i>, leaving the size unchanged.</p>
205
<p>See also <a href="qrect.html#bottomLeft">bottomLeft</a>(), <a href="qrect.html#setBottomLeft">setBottomLeft</a>(), <a href="qrect.html#moveTopLeft">moveTopLeft</a>(), <a href="qrect.html#moveBottomRight">moveBottomRight</a>(), and <a href="qrect.html#moveTopRight">moveTopRight</a>().</p>
206
<h3 class="fn"><a name="moveBottomRight"></a>void QRect::moveBottomRight ( const <a href="qpoint.html">QPoint</a> & <i>p</i> )</h3>
207
<p>Sets the bottom-right position of the rectangle to <i>p</i>, leaving the size unchanged.</p>
208
<p>See also <a href="qrect.html#bottomRight">bottomRight</a>(), <a href="qrect.html#setBottomRight">setBottomRight</a>(), <a href="qrect.html#moveTopLeft">moveTopLeft</a>(), <a href="qrect.html#moveTopRight">moveTopRight</a>(), and <a href="qrect.html#moveBottomLeft">moveBottomLeft</a>().</p>
209
<h3 class="fn"><a name="moveCenter"></a>void QRect::moveCenter ( const <a href="qpoint.html">QPoint</a> & <i>p</i> )</h3>
210
<p>Sets the center point of the rectangle to <i>p</i>, leaving the size unchanged.</p>
211
<p>See also <a href="qrect.html#center">center</a>(), <a href="qrect.html#moveTopLeft">moveTopLeft</a>(), <a href="qrect.html#moveBottomRight">moveBottomRight</a>(), <a href="qrect.html#moveTopRight">moveTopRight</a>(), and <a href="qrect.html#moveBottomLeft">moveBottomLeft</a>().</p>
212
<h3 class="fn"><a name="moveLeft"></a>void QRect::moveLeft ( int <i>pos</i> )</h3>
213
<p>Sets the left position of the rectangle to <i>pos</i>, leaving the size unchanged.</p>
214
<p>See also <a href="qrect.html#left">left</a>(), <a href="qrect.html#setLeft">setLeft</a>(), <a href="qrect.html#moveTop">moveTop</a>(), <a href="qrect.html#moveRight">moveRight</a>(), and <a href="qrect.html#moveBottom">moveBottom</a>().</p>
215
<h3 class="fn"><a name="moveRight"></a>void QRect::moveRight ( int <i>pos</i> )</h3>
216
<p>Sets the right position of the rectangle to <i>pos</i>, leaving the size unchanged.</p>
217
<p>See also <a href="qrect.html#right">right</a>(), <a href="qrect.html#setRight">setRight</a>(), <a href="qrect.html#moveLeft">moveLeft</a>(), <a href="qrect.html#moveTop">moveTop</a>(), and <a href="qrect.html#moveBottom">moveBottom</a>().</p>
218
<h3 class="fn"><a name="moveTo"></a>void QRect::moveTo ( int <i>x</i>, int <i>y</i> )</h3>
219
<p>Moves the top left corner of the rectangle to <i>x</i> and <i>y</i>, without changing the rectangles size.</p>
220
<p>See also <a href="qrect.html#translate">translate</a>() and <a href="qrect.html#moveTopLeft">moveTopLeft</a>().</p>
221
<h3 class="fn"><a name="moveTo-2"></a>void QRect::moveTo ( const <a href="qpoint.html">QPoint</a> & <i>pt</i> )</h3>
222
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
223
<p>Moves the top left corner of the rectangle to <i>pt</i>, without changing the rectangles size.</p>
224
<p>See also <a href="qrect.html#translate">translate</a>() and <a href="qrect.html#moveTopLeft">moveTopLeft</a>().</p>
225
<h3 class="fn"><a name="moveTop"></a>void QRect::moveTop ( int <i>pos</i> )</h3>
226
<p>Sets the top position of the rectangle to <i>pos</i>, leaving the size unchanged.</p>
227
<p>See also <a href="qrect.html#top">top</a>(), <a href="qrect.html#setTop">setTop</a>(), <a href="qrect.html#moveLeft">moveLeft</a>(), <a href="qrect.html#moveRight">moveRight</a>(), and <a href="qrect.html#moveBottom">moveBottom</a>().</p>
228
<h3 class="fn"><a name="moveTopLeft"></a>void QRect::moveTopLeft ( const <a href="qpoint.html">QPoint</a> & <i>p</i> )</h3>
229
<p>Sets the top-left position of the rectangle to <i>p</i>, leaving the size unchanged.</p>
230
<p>See also <a href="qrect.html#topLeft">topLeft</a>(), <a href="qrect.html#setTopLeft">setTopLeft</a>(), <a href="qrect.html#moveBottomRight">moveBottomRight</a>(), <a href="qrect.html#moveTopRight">moveTopRight</a>(), and <a href="qrect.html#moveBottomLeft">moveBottomLeft</a>().</p>
231
<h3 class="fn"><a name="moveTopRight"></a>void QRect::moveTopRight ( const <a href="qpoint.html">QPoint</a> & <i>p</i> )</h3>
232
<p>Sets the top-right position of the rectangle to <i>p</i>, leaving the size unchanged.</p>
233
<p>See also <a href="qrect.html#topRight">topRight</a>(), <a href="qrect.html#setTopRight">setTopRight</a>(), <a href="qrect.html#moveTopLeft">moveTopLeft</a>(), <a href="qrect.html#moveBottomRight">moveBottomRight</a>(), and <a href="qrect.html#moveBottomLeft">moveBottomLeft</a>().</p>
234
<h3 class="fn"><a name="normalized"></a>QRect QRect::normalized () const</h3>
235
<p>Returns a normalized rectangle, i.e. a rectangle that has a non-negative width and height.</p>
236
<p>It swaps left and right if <a href="qrect.html#left">left</a>() > <a href="qrect.html#right">right</a>(), and swaps top and bottom if <a href="qrect.html#top">top</a>() > <a href="qrect.html#bottom">bottom</a>().</p>
237
<p>See also <a href="qrect.html#isValid">isValid</a>().</p>
238
<h3 class="fn"><a name="right"></a>int QRect::right () const</h3>
239
<p>Returns the right coordinate of the rectangle.</p>
240
<p>See also <a href="qrect.html#setRight">setRight</a>(), <a href="qrect.html#left">left</a>(), <a href="qrect.html#topRight">topRight</a>(), and <a href="qrect.html#bottomRight">bottomRight</a>().</p>
241
<h3 class="fn"><a name="setBottom"></a>void QRect::setBottom ( int <i>pos</i> )</h3>
242
<p>Sets the bottom edge of the rectangle to <i>pos</i>. May change the height, but will never change the top edge of the rectangle.</p>
243
<p>See also <a href="qrect.html#bottom">bottom</a>(), <a href="qrect.html#setTop">setTop</a>(), and <a href="qrect.html#setHeight">setHeight</a>().</p>
244
<h3 class="fn"><a name="setBottomLeft"></a>void QRect::setBottomLeft ( const <a href="qpoint.html">QPoint</a> & <i>p</i> )</h3>
245
<p>Set the bottom-left corner of the rectangle to <i>p</i>. May change the size, but will the never change the top-right corner of the rectangle.</p>
246
<p>See also <a href="qrect.html#bottomLeft">bottomLeft</a>(), <a href="qrect.html#moveBottomLeft">moveBottomLeft</a>(), <a href="qrect.html#setTopLeft">setTopLeft</a>(), <a href="qrect.html#setBottomRight">setBottomRight</a>(), and <a href="qrect.html#setTopRight">setTopRight</a>().</p>
247
<h3 class="fn"><a name="setBottomRight"></a>void QRect::setBottomRight ( const <a href="qpoint.html">QPoint</a> & <i>p</i> )</h3>
248
<p>Set the bottom-right corner of the rectangle to <i>p</i>. May change the size, but will the never change the top-left corner of the rectangle.</p>
249
<p>See also <a href="qrect.html#bottomRight">bottomRight</a>(), <a href="qrect.html#moveBottomRight">moveBottomRight</a>(), <a href="qrect.html#setTopLeft">setTopLeft</a>(), <a href="qrect.html#setTopRight">setTopRight</a>(), and <a href="qrect.html#setBottomLeft">setBottomLeft</a>().</p>
250
<h3 class="fn"><a name="setCoords"></a>void QRect::setCoords ( int <i>xp1</i>, int <i>yp1</i>, int <i>xp2</i>, int <i>yp2</i> )</h3>
251
<p>Sets the coordinates of the rectangle's top-left corner to (<i>xp1</i>, <i>yp1</i>), and the coordinates of its bottom-right corner to (<i>xp2</i>, <i>yp2</i>).</p>
252
<p>See also <a href="qrect.html#getCoords">getCoords</a>() and <a href="qrect.html#setRect">setRect</a>().</p>
253
<h3 class="fn"><a name="setHeight"></a>void QRect::setHeight ( int <i>h</i> )</h3>
254
<p>Sets the height of the rectangle to <i>h</i>. The top edge is not moved, but the bottom edge may be moved.</p>
255
<p>See also <a href="qrect.html#height">height</a>(), <a href="qrect.html#setTop">setTop</a>(), <a href="qrect.html#setBottom">setBottom</a>(), and <a href="qrect.html#setSize">setSize</a>().</p>
256
<h3 class="fn"><a name="setLeft"></a>void QRect::setLeft ( int <i>pos</i> )</h3>
257
<p>Sets the left edge of the rectangle to <i>pos</i>. May change the width, but will never change the right edge of the rectangle.</p>
258
<p>Identical to <a href="qrect.html#setX">setX</a>().</p>
259
<p>See also <a href="qrect.html#left">left</a>(), <a href="qrect.html#setTop">setTop</a>(), and <a href="qrect.html#setWidth">setWidth</a>().</p>
260
<h3 class="fn"><a name="setRect"></a>void QRect::setRect ( int <i>x</i>, int <i>y</i>, int <i>w</i>, int <i>h</i> )</h3>
261
<p>Sets the coordinates of the rectangle's top-left corner to (<i>x</i>, <i>y</i>), and its size to (<i>w</i>, <i>h</i>).</p>
262
<p>See also <a href="qrect.html#getRect">getRect</a>() and <a href="qrect.html#setCoords">setCoords</a>().</p>
263
<h3 class="fn"><a name="setRight"></a>void QRect::setRight ( int <i>pos</i> )</h3>
264
<p>Sets the right edge of the rectangle to <i>pos</i>. May change the width, but will never change the left edge of the rectangle.</p>
265
<p>See also <a href="qrect.html#right">right</a>(), <a href="qrect.html#setLeft">setLeft</a>(), and <a href="qrect.html#setWidth">setWidth</a>().</p>
266
<h3 class="fn"><a name="setSize"></a>void QRect::setSize ( const <a href="qsize.html">QSize</a> & <i>s</i> )</h3>
267
<p>Sets the size of the rectangle to <i>s</i>. The top-left corner is not moved.</p>
268
<p>See also <a href="qrect.html#size">size</a>(), <a href="qrect.html#setWidth">setWidth</a>(), and <a href="qrect.html#setHeight">setHeight</a>().</p>
269
<h3 class="fn"><a name="setTop"></a>void QRect::setTop ( int <i>pos</i> )</h3>
270
<p>Sets the top edge of the rectangle to <i>pos</i>. May change the height, but will never change the bottom edge of the rectangle.</p>
271
<p>Identical to <a href="qrect.html#setY">setY</a>().</p>
272
<p>See also <a href="qrect.html#top">top</a>(), <a href="qrect.html#setBottom">setBottom</a>(), and <a href="qrect.html#setHeight">setHeight</a>().</p>
273
<h3 class="fn"><a name="setTopLeft"></a>void QRect::setTopLeft ( const <a href="qpoint.html">QPoint</a> & <i>p</i> )</h3>
274
<p>Set the top-left corner of the rectangle to <i>p</i>. May change the size, but will the never change the bottom-right corner of the rectangle.</p>
275
<p>See also <a href="qrect.html#topLeft">topLeft</a>(), <a href="qrect.html#moveTopLeft">moveTopLeft</a>(), <a href="qrect.html#setBottomRight">setBottomRight</a>(), <a href="qrect.html#setTopRight">setTopRight</a>(), and <a href="qrect.html#setBottomLeft">setBottomLeft</a>().</p>
276
<h3 class="fn"><a name="setTopRight"></a>void QRect::setTopRight ( const <a href="qpoint.html">QPoint</a> & <i>p</i> )</h3>
277
<p>Set the top-right corner of the rectangle to <i>p</i>. May change the size, but will the never change the bottom-left corner of the rectangle.</p>
278
<p>See also <a href="qrect.html#topRight">topRight</a>(), <a href="qrect.html#moveTopRight">moveTopRight</a>(), <a href="qrect.html#setTopLeft">setTopLeft</a>(), <a href="qrect.html#setBottomRight">setBottomRight</a>(), and <a href="qrect.html#setBottomLeft">setBottomLeft</a>().</p>
279
<h3 class="fn"><a name="setWidth"></a>void QRect::setWidth ( int <i>w</i> )</h3>
280
<p>Sets the width of the rectangle to <i>w</i>. The right edge is changed, but not the left edge.</p>
281
<p>See also <a href="qrect.html#width">width</a>(), <a href="qrect.html#setLeft">setLeft</a>(), <a href="qrect.html#setRight">setRight</a>(), and <a href="qrect.html#setSize">setSize</a>().</p>
282
<h3 class="fn"><a name="setX"></a>void QRect::setX ( int <i>x</i> )</h3>
283
<p>Sets the x position of the rectangle (its left end) to <i>x</i>. May change the width, but will never change the right edge of the rectangle.</p>
284
<p>Identical to <a href="qrect.html#setLeft">setLeft</a>().</p>
285
<p>See also <a href="qrect.html#x">x</a>() and <a href="qrect.html#setY">setY</a>().</p>
286
<h3 class="fn"><a name="setY"></a>void QRect::setY ( int <i>y</i> )</h3>
287
<p>Sets the y position of the rectangle (its top) to <i>y</i>. May change the height, but will never change the bottom edge of the rectangle.</p>
288
<p>Identical to <a href="qrect.html#setTop">setTop</a>().</p>
289
<p>See also <a href="qrect.html#y">y</a>() and <a href="qrect.html#setX">setX</a>().</p>
290
<h3 class="fn"><a name="size"></a><a href="qsize.html">QSize</a> QRect::size () const</h3>
291
<p>Returns the size of the rectangle.</p>
292
<p>See also <a href="qrect.html#width">width</a>() and <a href="qrect.html#height">height</a>().</p>
293
<h3 class="fn"><a name="top"></a>int QRect::top () const</h3>
294
<p>Returns the top coordinate of the rectangle. Identical to <a href="qrect.html#y">y</a>().</p>
295
<p>See also <a href="qrect.html#setTop">setTop</a>(), <a href="qrect.html#bottom">bottom</a>(), <a href="qrect.html#topLeft">topLeft</a>(), and <a href="qrect.html#topRight">topRight</a>().</p>
296
<h3 class="fn"><a name="topLeft"></a><a href="qpoint.html">QPoint</a> QRect::topLeft () const</h3>
297
<p>Returns the top-left position of the rectangle.</p>
298
<p>See also <a href="qrect.html#setTopLeft">setTopLeft</a>(), <a href="qrect.html#moveTopLeft">moveTopLeft</a>(), <a href="qrect.html#bottomRight">bottomRight</a>(), <a href="qrect.html#left">left</a>(), and <a href="qrect.html#top">top</a>().</p>
299
<h3 class="fn"><a name="topRight"></a><a href="qpoint.html">QPoint</a> QRect::topRight () const</h3>
300
<p>Returns the top-right position of the rectangle.</p>
301
<p>See also <a href="qrect.html#setTopRight">setTopRight</a>(), <a href="qrect.html#moveTopRight">moveTopRight</a>(), <a href="qrect.html#bottomLeft">bottomLeft</a>(), <a href="qrect.html#top">top</a>(), and <a href="qrect.html#right">right</a>().</p>
302
<h3 class="fn"><a name="translate"></a>void QRect::translate ( int <i>dx</i>, int <i>dy</i> )</h3>
303
<p>Moves the rectangle <i>dx</i> along the x axis and <i>dy</i> along the y axis, relative to the current position. Positive values move the rectangle to the right and down.</p>
304
<p>See also <a href="qrect.html#moveTopLeft">moveTopLeft</a>(), <a href="qrect.html#moveTo">moveTo</a>(), and <a href="qrect.html#translated">translated</a>().</p>
305
<h3 class="fn"><a name="translate-2"></a>void QRect::translate ( const <a href="qpoint.html">QPoint</a> & <i>p</i> )</h3>
306
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
307
<p>Moves the rectangle <i>p</i><i>.<a href="qrect.html#x">x</a>()</i> along the x axis and <i>p</i><i>.<a href="qrect.html#y">y</a>()</i> along the y axis, relative to the current position. Positive values move the rectangle to the right and down.</p>
308
<p>See also <a href="qrect.html#moveTopLeft">moveTopLeft</a>().</p>
309
<h3 class="fn"><a name="translated"></a>QRect QRect::translated ( int <i>dx</i>, int <i>dy</i> ) const</h3>
310
<p>Returns a copy of the rectangle that is translated <i>dx</i> along the x axis and <i>dy</i> along the y axis, relative to the current position. Positive values move the rectangle to the right and down.</p>
311
<p>See also <a href="qrect.html#translate">translate</a>().</p>
312
<h3 class="fn"><a name="translated-2"></a>QRect QRect::translated ( const <a href="qpoint.html">QPoint</a> & <i>p</i> ) const</h3>
313
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
314
<p>Returns a copy of the rectangle that is translated <i>p</i><i>.<a href="qrect.html#x">x</a>()</i> along the x axis and <i>p</i><i>.<a href="qrect.html#y">y</a>()</i> along the y axis, relative to the current position. Positive values move the rectangle to the right and down.</p>
315
<p>See also <a href="qrect.html#translate">translate</a>().</p>
316
<h3 class="fn"><a name="unite"></a>QRect QRect::unite ( const QRect & <i>r</i> ) const</h3>
317
<p>Returns the bounding rectangle of this rectangle and rectangle <i>r</i>. <tt>r.unite(s)</tt> is equivalent to <tt>r|s</tt>.</p>
318
<h3 class="fn"><a name="width"></a>int QRect::width () const</h3>
319
<p>Returns the width of the rectangle.</p>
320
<p>See also <a href="qrect.html#height">height</a>(), <a href="qrect.html#size">size</a>(), and <a href="qrect.html#setHeight">setHeight</a>().</p>
321
<h3 class="fn"><a name="x"></a>int QRect::x () const</h3>
322
<p>Returns the left coordinate of the rectangle. Identical to <a href="qrect.html#left">left</a>().</p>
323
<p>See also <a href="qrect.html#left">left</a>(), <a href="qrect.html#y">y</a>(), and <a href="qrect.html#setX">setX</a>().</p>
324
<h3 class="fn"><a name="y"></a>int QRect::y () const</h3>
325
<p>Returns the top coordinate of the rectangle. Identical to <a href="qrect.html#top">top</a>().</p>
326
<p>See also <a href="qrect.html#top">top</a>(), <a href="qrect.html#x">x</a>(), and <a href="qrect.html#setY">setY</a>().</p>
327
<h3 class="fn"><a name="operator-and"></a>QRect QRect::operator& ( const QRect & <i>r</i> ) const</h3>
328
<p>Returns the intersection of this rectangle and rectangle <i>r</i>.</p>
329
<p>Returns an empty rectangle if there is no intersection.</p>
330
<p>This is equivalent to calling</p>
331
<pre> intersect(r)</pre>
333
<p>See also <a href="qrect.html#operator-and-eq">operator&=</a>(), <a href="qrect.html#operator-7c">operator|</a>(), <a href="qrect.html#isEmpty">isEmpty</a>(), <a href="qrect.html#intersect">intersect</a>(), <a href="qrect.html#contains">contains</a>(), and <a href="qrect.html#unite">unite</a>().</p>
334
<h3 class="fn"><a name="operator-and-eq"></a>QRect & QRect::operator&= ( const QRect & <i>r</i> )</h3>
335
<p>Intersects this rectangle with rectangle <i>r</i>.</p>
336
<h3 class="fn"><a name="operator-7c"></a>QRect QRect::operator| ( const QRect & <i>r</i> ) const</h3>
337
<p>Returns the bounding rectangle of this rectangle and rectangle <i>r</i>.</p>
338
<p>This is the equivalent to calling</p>
339
<pre> unite(r)</pre>
341
<p>See also <a href="qrect.html#operator-7c-eq">operator|=</a>(), <a href="qrect.html#operator-and">operator&</a>(), <a href="qrect.html#intersect">intersect</a>(), <a href="qrect.html#contains">contains</a>(), and <a href="qrect.html#unite">unite</a>().</p>
342
<h3 class="fn"><a name="operator-7c-eq"></a>QRect & QRect::operator|= ( const QRect & <i>r</i> )</h3>
343
<p>Unites this rectangle with rectangle <i>r</i>.</p>
345
<h2>Related Non-Members</h2>
346
<h3 class="fn"><a name="operator-not-eq-14"></a>bool operator!= ( const QRect & <i>r1</i>, const QRect & <i>r2</i> )</h3>
347
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
348
<p>Returns true if the rectangles <i>r1</i> and <i>r2</i> are different; otherwise returns false.</p>
349
<h3 class="fn"><a name="operator-lt-lt-44"></a><a href="qdatastream.html">QDataStream</a> & operator<< ( <a href="qdatastream.html">QDataStream</a> & <i>stream</i>, const QRect & <i>rectangle</i> )</h3>
350
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
351
<p>Writes the <i>rectangle</i> to the <i>stream</i>, and returns a reference to the stream.</p>
352
<p>See also <a href="datastreamformat.html">Format of the QDataStream operators</a>.</p>
353
<h3 class="fn"><a name="operator-eq-eq-21"></a>bool operator== ( const QRect & <i>r1</i>, const QRect & <i>r2</i> )</h3>
354
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
355
<p>Returns true if the rectangles <i>r1</i> and <i>r2</i> are equal; otherwise returns false.</p>
356
<h3 class="fn"><a name="operator-gt-gt-29"></a><a href="qdatastream.html">QDataStream</a> & operator>> ( <a href="qdatastream.html">QDataStream</a> & <i>stream</i>, QRect & <i>rectangle</i> )</h3>
357
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
358
<p>Reads a <i>rectangle</i> from the <i>stream</i>, and returns a reference to the stream.</p>
359
<p>See also <a href="datastreamformat.html">Format of the QDataStream operators</a>.</p>
360
<p /><address><hr /><div align="center">
361
<table width="100%" cellspacing="0" border="0"><tr class="address">
362
<td width="30%">Copyright © 2005 <a href="trolltech.html">Trolltech</a></td>
363
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
364
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
365
</tr></table></div></address></body>