File: qrect.html

package info (click to toggle)
qt4-x11 4%3A4.8.2%2Bdfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 701,696 kB
  • sloc: cpp: 2,686,179; ansic: 375,485; python: 25,859; sh: 19,349; xml: 17,091; perl: 14,765; yacc: 5,383; asm: 5,038; makefile: 1,259; lex: 555; ruby: 526; objc: 347; cs: 112; pascal: 112; php: 54; sed: 34
file content (565 lines) | stat: -rw-r--r-- 65,448 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qrect.cpp -->
  <title>Qt 4.8: QRect Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtcore.html">QtCore</a></li>
<li>QRect</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#rendering">Rendering</a></li>
<li class="level2"><a href="#coordinates">Coordinates</a></li>
</ul>
</div>
<h1 class="title">QRect Class Reference</h1>
<!-- $$$QRect-brief -->
<p>The QRect class defines a rectangle in the plane using integer precision. <a href="#details">More...</a></p>
<!-- @@@QRect -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QRect&gt;</span></pre><ul>
<li><a href="qrect-members.html">List of all members, including inherited members</a></li>
<li><a href="qrect-obsolete.html">Obsolete members</a></li>
<li><a href="qrect-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#QRect">QRect</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#QRect-2">QRect</a></b> ( const QPoint &amp; <i>topLeft</i>, const QPoint &amp; <i>bottomRight</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#QRect-3">QRect</a></b> ( const QPoint &amp; <i>topLeft</i>, const QSize &amp; <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#QRect-4">QRect</a></b> ( int <i>x</i>, int <i>y</i>, int <i>width</i>, int <i>height</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#adjust">adjust</a></b> ( int <i>dx1</i>, int <i>dy1</i>, int <i>dx2</i>, int <i>dy2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#adjusted">adjusted</a></b> ( int <i>dx1</i>, int <i>dy1</i>, int <i>dx2</i>, int <i>dy2</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#bottom">bottom</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPoint </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#bottomLeft">bottomLeft</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPoint </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#bottomRight">bottomRight</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPoint </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#center">center</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#contains">contains</a></b> ( const QPoint &amp; <i>point</i>, bool <i>proper</i> = false ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#contains-2">contains</a></b> ( int <i>x</i>, int <i>y</i>, bool <i>proper</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#contains-3">contains</a></b> ( int <i>x</i>, int <i>y</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#contains-4">contains</a></b> ( const QRect &amp; <i>rectangle</i>, bool <i>proper</i> = false ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#getCoords">getCoords</a></b> ( int * <i>x1</i>, int * <i>y1</i>, int * <i>x2</i>, int * <i>y2</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#getRect">getRect</a></b> ( int * <i>x</i>, int * <i>y</i>, int * <i>width</i>, int * <i>height</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#height">height</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#intersected">intersected</a></b> ( const QRect &amp; <i>rectangle</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#intersects">intersects</a></b> ( const QRect &amp; <i>rectangle</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#isEmpty">isEmpty</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#isNull">isNull</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#isValid">isValid</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#left">left</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#moveBottom">moveBottom</a></b> ( int <i>y</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#moveBottomLeft">moveBottomLeft</a></b> ( const QPoint &amp; <i>position</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#moveBottomRight">moveBottomRight</a></b> ( const QPoint &amp; <i>position</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#moveCenter">moveCenter</a></b> ( const QPoint &amp; <i>position</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#moveLeft">moveLeft</a></b> ( int <i>x</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#moveRight">moveRight</a></b> ( int <i>x</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#moveTo">moveTo</a></b> ( int <i>x</i>, int <i>y</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#moveTo-2">moveTo</a></b> ( const QPoint &amp; <i>position</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#moveTop">moveTop</a></b> ( int <i>y</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#moveTopLeft">moveTopLeft</a></b> ( const QPoint &amp; <i>position</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#moveTopRight">moveTopRight</a></b> ( const QPoint &amp; <i>position</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#normalized">normalized</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#right">right</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#setBottom">setBottom</a></b> ( int <i>y</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#setBottomLeft">setBottomLeft</a></b> ( const QPoint &amp; <i>position</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#setBottomRight">setBottomRight</a></b> ( const QPoint &amp; <i>position</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#setCoords">setCoords</a></b> ( int <i>x1</i>, int <i>y1</i>, int <i>x2</i>, int <i>y2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#setHeight">setHeight</a></b> ( int <i>height</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#setLeft">setLeft</a></b> ( int <i>x</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#setRect">setRect</a></b> ( int <i>x</i>, int <i>y</i>, int <i>width</i>, int <i>height</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#setRight">setRight</a></b> ( int <i>x</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#setSize">setSize</a></b> ( const QSize &amp; <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#setTop">setTop</a></b> ( int <i>y</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#setTopLeft">setTopLeft</a></b> ( const QPoint &amp; <i>position</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#setTopRight">setTopRight</a></b> ( const QPoint &amp; <i>position</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#setWidth">setWidth</a></b> ( int <i>width</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#setX">setX</a></b> ( int <i>x</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#setY">setY</a></b> ( int <i>y</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSize </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#size">size</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#top">top</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPoint </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#topLeft">topLeft</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPoint </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#topRight">topRight</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#translate">translate</a></b> ( int <i>dx</i>, int <i>dy</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#translate-2">translate</a></b> ( const QPoint &amp; <i>offset</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#translated">translated</a></b> ( int <i>dx</i>, int <i>dy</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#translated-2">translated</a></b> ( const QPoint &amp; <i>offset</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#united">united</a></b> ( const QRect &amp; <i>rectangle</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#width">width</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#x">x</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#y">y</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#operator-and">operator&amp;</a></b> ( const QRect &amp; <i>rectangle</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect &amp; </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#operator-and-eq">operator&amp;=</a></b> ( const QRect &amp; <i>rectangle</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#operator-7c">operator|</a></b> ( const QRect &amp; <i>rectangle</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect &amp; </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#operator-7c-eq">operator|=</a></b> ( const QRect &amp; <i>rectangle</i> )</td></tr>
</table>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#operator-not-eq-49">operator!=</a></b> ( const QRect &amp; <i>r1</i>, const QRect &amp; <i>r2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#operator-lt-lt-178">operator&lt;&lt;</a></b> ( QDataStream &amp; <i>stream</i>, const QRect &amp; <i>rectangle</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#operator-eq-eq-73">operator==</a></b> ( const QRect &amp; <i>r1</i>, const QRect &amp; <i>r2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qrect.html#operator-gt-gt-98">operator&gt;&gt;</a></b> ( QDataStream &amp; <i>stream</i>, QRect &amp; <i>rectangle</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QRect-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QRect class defines a rectangle in the plane using integer precision.</p>
<p>A rectangle is normally expressed as an upper-left corner and a size. The size (width and height) of a QRect is always equivalent to the mathematical rectangle that forms the basis for its rendering.</p>
<p>A QRect can be constructed with a set of left, top, width and height integers, or from a <a href="qpoint.html">QPoint</a> and a <a href="qsize.html">QSize</a>. The following code creates two identical rectangles.</p>
<pre class="cpp"> <span class="type">QRect</span> r1(<span class="number">100</span><span class="operator">,</span> <span class="number">200</span><span class="operator">,</span> <span class="number">11</span><span class="operator">,</span> <span class="number">16</span>);
 <span class="type">QRect</span> r2(<span class="type"><a href="qpoint.html">QPoint</a></span>(<span class="number">100</span><span class="operator">,</span> <span class="number">200</span>)<span class="operator">,</span> <span class="type"><a href="qsize.html">QSize</a></span>(<span class="number">11</span><span class="operator">,</span> <span class="number">16</span>));</pre>
<p>There is a third constructor that creates a QRect using the top-left and bottom-right coordinates, but we recommend that you avoid using it. The rationale is that for historical reasons the values returned by the <a href="qrect.html#bottom">bottom</a>() and <a href="qrect.html#right">right</a>() functions deviate from the true bottom-right corner of the rectangle.</p>
<p>The QRect class provides a collection of functions that return the various rectangle coordinates, and enable manipulation of these. QRect also provide functions to move the rectangle relative to the various coordinates. In addition there is a <a href="qrect.html#moveTo">moveTo</a>() function that moves the rectangle, leaving its top left corner at the given coordinates. Alternatively, the <a href="qrect.html#translate">translate</a>() function moves the rectangle the given offset relative to the current position, and the <a href="qrect.html#translated">translated</a>() function returns a translated copy of this rectangle.</p>
<p>The <a href="qrect.html#size">size</a>() function returns the rectange's dimensions as a <a href="qsize.html">QSize</a>. The dimensions can also be retrieved separately using the <a href="qrect.html#width">width</a>() and <a href="qrect.html#height">height</a>() functions. To manipulate the dimensions use the <a href="qrect.html#setSize">setSize</a>(), <a href="qrect.html#setWidth">setWidth</a>() or <a href="qrect.html#setHeight">setHeight</a>() functions. Alternatively, the size can be changed by applying either of the functions setting the rectangle coordinates, for example, <a href="qrect.html#setBottom">setBottom</a>() or <a href="qrect.html#setRight">setRight</a>().</p>
<p>The <a href="qrect.html#contains">contains</a>() function tells whether a given point is inside the rectangle or not, and the <a href="qrect.html#intersects">intersects</a>() function returns true if this rectangle intersects with a given rectangle. The QRect class also provides the <a href="qrect.html#intersected">intersected</a>() function which returns the intersection rectangle, and the <a href="qrect.html#united">united</a>() function which returns the rectangle that encloses the given rectangle and this:</p>
<table class="generic">
<tr valign="top" class="odd"><td ><img src="images/qrect-intersect.png" alt="" /></td><td ><img src="images/qrect-unite.png" alt="" /></td></tr>
<tr valign="top" class="even"><td ><a href="qrect.html#intersected">intersected</a>()</td><td ><a href="qrect.html#united">united</a>()</td></tr>
</table>
<p>The <a href="qrect.html#isEmpty">isEmpty</a>() function returns true if <a href="qrect.html#left">left</a>() &gt; <a href="qrect.html#right">right</a>() or <a href="qrect.html#top">top</a>() &gt; <a href="qrect.html#bottom">bottom</a>(). Note that an empty rectangle is not valid: The <a href="qrect.html#isValid">isValid</a>() function returns true if <a href="qrect.html#left">left</a>() &lt;= <a href="qrect.html#right">right</a>() <i>and</i> <a href="qrect.html#top">top</a>() &lt;= <a href="qrect.html#bottom">bottom</a>(). A null rectangle (<a href="qrect.html#isNull">isNull</a>() == true) on the other hand, has both width and height set to 0.</p>
<p>Note that due to the way QRect and <a href="qrectf.html">QRectF</a> are defined, an empty QRect is defined in essentially the same way as <a href="qrectf.html">QRectF</a>.</p>
<p>Finally, QRect objects can be streamed as well as compared.</p>
<a name="rendering"></a>
<h3>Rendering</h3>
<p>When using an <a href="qpainter.html#RenderHint-enum">anti-aliased</a> painter, the boundary line of a QRect will be rendered symmetrically on both sides of the mathematical rectangle's boundary line. But when using an aliased painter (the default) other rules apply.</p>
<p>Then, when rendering with a one pixel wide pen the QRect's boundary line will be rendered to the right and below the mathematical rectangle's boundary line.</p>
<p>When rendering with a two pixels wide pen the boundary line will be split in the middle by the mathematical rectangle. This will be the case whenever the pen is set to an even number of pixels, while rendering with a pen with an odd number of pixels, the spare pixel will be rendered to the right and below the mathematical rectangle as in the one pixel case.</p>
<table class="generic">
<tr valign="top" class="odd"><td ><img src="images/qrect-diagram-zero.png" alt="" /></td><td ><img src="images/qrect-diagram-one.png" alt="" /></td></tr>
<tr valign="top" class="even"><td >Logical representation</td><td >One pixel wide pen</td></tr>
<tr valign="top" class="odd"><td ><img src="images/qrect-diagram-two.png" alt="" /></td><td ><img src="images/qrect-diagram-three.png" alt="" /></td></tr>
<tr valign="top" class="even"><td >Two pixel wide pen</td><td >Three pixel wide pen</td></tr>
</table>
<a name="coordinates"></a>
<h3>Coordinates</h3>
<p>The QRect class provides a collection of functions that return the various rectangle coordinates, and enable manipulation of these. QRect also provide functions to move the rectangle relative to the various coordinates.</p>
<p>For example the <a href="qrect.html#left">left</a>(), <a href="qrect.html#setLeft">setLeft</a>() and <a href="qrect.html#moveLeft">moveLeft</a>() functions as an example: <a href="qrect.html#left">left</a>() returns the x-coordinate of the rectangle's left edge, <a href="qrect.html#setLeft">setLeft</a>() sets the left edge of the rectangle to the given x coordinate (it may change the width, but will never change the rectangle's right edge) and <a href="qrect.html#moveLeft">moveLeft</a>() moves the entire rectangle horizontally, leaving the rectangle's left edge at the given x coordinate and its size unchanged.</p>
<p class="centerAlign"><img src="images/qrect-coordinates.png" alt="" /></p><p>Note that for historical reasons the values returned by the <a href="qrect.html#bottom">bottom</a>() and <a href="qrect.html#right">right</a>() functions deviate from the true bottom-right corner of the rectangle: The <a href="qrect.html#right">right</a>() function returns <i> <a href="qrect.html#left">left</a>() + <a href="qrect.html#width">width</a>() - 1</i> and the <a href="qrect.html#bottom">bottom</a>() function returns <i><a href="qrect.html#top">top</a>() + <a href="qrect.html#height">height</a>() - 1</i>. The same is the case for the point returned by the <a href="qrect.html#bottomRight">bottomRight</a>() convenience function. In addition, the x and y coordinate of the <a href="qrect.html#topRight">topRight</a>() and <a href="qrect.html#bottomLeft">bottomLeft</a>() functions, respectively, contain the same deviation from the true right and bottom edges.</p>
<p>We recommend that you use <a href="qrect.html#x">x</a>() + <a href="qrect.html#width">width</a>() and <a href="qrect.html#y">y</a>() + <a href="qrect.html#height">height</a>() to find the true bottom-right corner, and avoid <a href="qrect.html#right">right</a>() and <a href="qrect.html#bottom">bottom</a>(). Another solution is to use <a href="qrectf.html">QRectF</a>: The <a href="qrectf.html">QRectF</a> class defines a rectangle in the plane using floating point accuracy for coordinates, and the <a href="qrectf.html#right">QRectF::right</a>() and <a href="qrectf.html#bottom">QRectF::bottom</a>() functions <i>do</i> return the right and bottom coordinates.</p>
<p>It is also possible to add offsets to this rectangle's coordinates using the <a href="qrect.html#adjust">adjust</a>() function, as well as retrieve a new rectangle based on adjustments of the original one using the <a href="qrect.html#adjusted">adjusted</a>() function. If either of the width and height is negative, use the <a href="qrect.html#normalized">normalized</a>() function to retrieve a rectangle where the corners are swapped.</p>
<p>In addition, QRect provides the <a href="qrect.html#getCoords">getCoords</a>() function which extracts the position of the rectangle's top-left and bottom-right corner, and the <a href="qrect.html#getRect">getRect</a>() function which extracts the rectangle's top-left corner, width and height. Use the <a href="qrect.html#setCoords">setCoords</a>() and <a href="qrect.html#setRect">setRect</a>() function to manipulate the rectangle's coordinates and dimensions in one go.</p>
</div>
<p><b>See also </b><a href="qrectf.html">QRectF</a> and <a href="qregion.html">QRegion</a>.</p>
<!-- @@@QRect -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QRect[overload1]$$$QRect -->
<h3 class="fn"><a name="QRect"></a>QRect::<span class="name">QRect</span> ()</h3>
<p>Constructs a null rectangle.</p>
<p><b>See also </b><a href="qrect.html#isNull">isNull</a>().</p>
<!-- @@@QRect -->
<!-- $$$QRect$$$QRectconstQPoint&constQPoint& -->
<h3 class="fn"><a name="QRect-2"></a>QRect::<span class="name">QRect</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>topLeft</i>, const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>bottomRight</i> )</h3>
<p>Constructs a rectangle with the given <i>topLeft</i> and <i>bottomRight</i> corners.</p>
<p><b>See also </b><a href="qrect.html#setTopLeft">setTopLeft</a>() and <a href="qrect.html#setBottomRight">setBottomRight</a>().</p>
<!-- @@@QRect -->
<!-- $$$QRect$$$QRectconstQPoint&constQSize& -->
<h3 class="fn"><a name="QRect-3"></a>QRect::<span class="name">QRect</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>topLeft</i>, const <span class="type"><a href="qsize.html">QSize</a></span> &amp; <i>size</i> )</h3>
<p>Constructs a rectangle with the given <i>topLeft</i> corner and the given <i>size</i>.</p>
<p><b>See also </b><a href="qrect.html#setTopLeft">setTopLeft</a>() and <a href="qrect.html#setSize">setSize</a>().</p>
<!-- @@@QRect -->
<!-- $$$QRect$$$QRectintintintint -->
<h3 class="fn"><a name="QRect-4"></a>QRect::<span class="name">QRect</span> ( <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i> )</h3>
<p>Constructs a rectangle with (<i>x</i>, <i>y</i>) as its top-left corner and the given <i>width</i> and <i>height</i>.</p>
<p><b>See also </b><a href="qrect.html#setRect">setRect</a>().</p>
<!-- @@@QRect -->
<!-- $$$adjust[overload1]$$$adjustintintintint -->
<h3 class="fn"><a name="adjust"></a><span class="type">void</span> QRect::<span class="name">adjust</span> ( <span class="type">int</span> <i>dx1</i>, <span class="type">int</span> <i>dy1</i>, <span class="type">int</span> <i>dx2</i>, <span class="type">int</span> <i>dy2</i> )</h3>
<p>Adds <i>dx1</i>, <i>dy1</i>, <i>dx2</i> and <i>dy2</i> respectively to the existing coordinates of the rectangle.</p>
<p><b>See also </b><a href="qrect.html#adjusted">adjusted</a>() and <a href="qrect.html#setRect">setRect</a>().</p>
<!-- @@@adjust -->
<!-- $$$adjusted[overload1]$$$adjustedintintintint -->
<h3 class="fn"><a name="adjusted"></a><span class="type">QRect</span> QRect::<span class="name">adjusted</span> ( <span class="type">int</span> <i>dx1</i>, <span class="type">int</span> <i>dy1</i>, <span class="type">int</span> <i>dx2</i>, <span class="type">int</span> <i>dy2</i> ) const</h3>
<p>Returns a new rectangle with <i>dx1</i>, <i>dy1</i>, <i>dx2</i> and <i>dy2</i> added respectively to the existing coordinates of this rectangle.</p>
<p><b>See also </b><a href="qrect.html#adjust">adjust</a>().</p>
<!-- @@@adjusted -->
<!-- $$$bottom[overload1]$$$bottom -->
<h3 class="fn"><a name="bottom"></a><span class="type">int</span> QRect::<span class="name">bottom</span> () const</h3>
<p>Returns the y-coordinate of the rectangle's bottom edge.</p>
<p>Note that for historical reasons this function returns <a href="qrect.html#top">top</a>() + <a href="qrect.html#height">height</a>() - 1; use <a href="qrect.html#y">y</a>() + <a href="qrect.html#height">height</a>() to retrieve the true y-coordinate.</p>
<p><b>See also </b><a href="qrect.html#setBottom">setBottom</a>(), <a href="qrect.html#bottomLeft">bottomLeft</a>(), and <a href="qrect.html#bottomRight">bottomRight</a>().</p>
<!-- @@@bottom -->
<!-- $$$bottomLeft[overload1]$$$bottomLeft -->
<h3 class="fn"><a name="bottomLeft"></a><span class="type"><a href="qpoint.html">QPoint</a></span> QRect::<span class="name">bottomLeft</span> () const</h3>
<p>Returns the position of the rectangle's bottom-left corner. Note that for historical reasons this function returns <a href="qpoint.html">QPoint</a>(<a href="qrect.html#left">left</a>(), <a href="qrect.html#top">top</a>() + <a href="qrect.html#height">height</a>() - 1).</p>
<p><b>See also </b><a href="qrect.html#setBottomLeft">setBottomLeft</a>(), <a href="qrect.html#bottom">bottom</a>(), and <a href="qrect.html#left">left</a>().</p>
<!-- @@@bottomLeft -->
<!-- $$$bottomRight[overload1]$$$bottomRight -->
<h3 class="fn"><a name="bottomRight"></a><span class="type"><a href="qpoint.html">QPoint</a></span> QRect::<span class="name">bottomRight</span> () const</h3>
<p>Returns the position of the rectangle's bottom-right corner.</p>
<p>Note that for historical reasons this function returns <a href="qpoint.html">QPoint</a>(<a href="qrect.html#left">left</a>() + <a href="qrect.html#width">width</a>() -1, <a href="qrect.html#top">top</a>() + <a href="qrect.html#height">height</a>() - 1).</p>
<p><b>See also </b><a href="qrect.html#setBottomRight">setBottomRight</a>(), <a href="qrect.html#bottom">bottom</a>(), and <a href="qrect.html#right">right</a>().</p>
<!-- @@@bottomRight -->
<!-- $$$center[overload1]$$$center -->
<h3 class="fn"><a name="center"></a><span class="type"><a href="qpoint.html">QPoint</a></span> QRect::<span class="name">center</span> () const</h3>
<p>Returns the center point of the rectangle.</p>
<p><b>See also </b><a href="qrect.html#moveCenter">moveCenter</a>().</p>
<!-- @@@center -->
<!-- $$$contains[overload1]$$$containsconstQPoint&bool -->
<h3 class="fn"><a name="contains"></a><span class="type">bool</span> QRect::<span class="name">contains</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>point</i>, <span class="type">bool</span> <i>proper</i> = false ) const</h3>
<p>Returns true if the given <i>point</i> is inside or on the edge of the rectangle, otherwise returns false. If <i>proper</i> is true, this function only returns true if the given <i>point</i> is <i>inside</i> the rectangle (i.e&#x2e;, not on the edge).</p>
<p><b>See also </b><a href="qrect.html#intersects">intersects</a>().</p>
<!-- @@@contains -->
<!-- $$$contains$$$containsintintbool -->
<h3 class="fn"><a name="contains-2"></a><span class="type">bool</span> QRect::<span class="name">contains</span> ( <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">bool</span> <i>proper</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns true if the point (<i>x</i>, <i>y</i>) is inside or on the edge of the rectangle, otherwise returns false. If <i>proper</i> is true, this function only returns true if the point is entirely inside the rectangle(not on the edge).</p>
<!-- @@@contains -->
<!-- $$$contains$$$containsintint -->
<h3 class="fn"><a name="contains-3"></a><span class="type">bool</span> QRect::<span class="name">contains</span> ( <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns true if the point (<i>x</i>, <i>y</i>) is inside this rectangle, otherwise returns false.</p>
<!-- @@@contains -->
<!-- $$$contains$$$containsconstQRect&bool -->
<h3 class="fn"><a name="contains-4"></a><span class="type">bool</span> QRect::<span class="name">contains</span> ( const <span class="type">QRect</span> &amp; <i>rectangle</i>, <span class="type">bool</span> <i>proper</i> = false ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns true if the given <i>rectangle</i> is inside this rectangle. otherwise returns false. If <i>proper</i> is true, this function only returns true if the <i>rectangle</i> is entirely inside this rectangle (not on the edge).</p>
<!-- @@@contains -->
<!-- $$$getCoords[overload1]$$$getCoordsint*int*int*int* -->
<h3 class="fn"><a name="getCoords"></a><span class="type">void</span> QRect::<span class="name">getCoords</span> ( <span class="type">int</span> * <i>x1</i>, <span class="type">int</span> * <i>y1</i>, <span class="type">int</span> * <i>x2</i>, <span class="type">int</span> * <i>y2</i> ) const</h3>
<p>Extracts the position of the rectangle's top-left corner to *<i>x1</i> and *<i>y1</i>, and the position of the bottom-right corner to *<i>x2</i> and *<i>y2</i>.</p>
<p><b>See also </b><a href="qrect.html#setCoords">setCoords</a>() and <a href="qrect.html#getRect">getRect</a>().</p>
<!-- @@@getCoords -->
<!-- $$$getRect[overload1]$$$getRectint*int*int*int* -->
<h3 class="fn"><a name="getRect"></a><span class="type">void</span> QRect::<span class="name">getRect</span> ( <span class="type">int</span> * <i>x</i>, <span class="type">int</span> * <i>y</i>, <span class="type">int</span> * <i>width</i>, <span class="type">int</span> * <i>height</i> ) const</h3>
<p>Extracts the position of the rectangle's top-left corner to *<i>x</i> and *<i>y</i>, and its dimensions to *<i>width</i> and *<i>height</i>.</p>
<p><b>See also </b><a href="qrect.html#setRect">setRect</a>() and <a href="qrect.html#getCoords">getCoords</a>().</p>
<!-- @@@getRect -->
<!-- $$$height[overload1]$$$height -->
<h3 class="fn"><a name="height"></a><span class="type">int</span> QRect::<span class="name">height</span> () const</h3>
<p>Returns the height of the rectangle.</p>
<p><b>See also </b><a href="qrect.html#setHeight">setHeight</a>(), <a href="qrect.html#width">width</a>(), and <a href="qrect.html#size">size</a>().</p>
<!-- @@@height -->
<!-- $$$intersected[overload1]$$$intersectedconstQRect& -->
<h3 class="fn"><a name="intersected"></a><span class="type">QRect</span> QRect::<span class="name">intersected</span> ( const <span class="type">QRect</span> &amp; <i>rectangle</i> ) const</h3>
<p>Returns the intersection of this rectangle and the given <i>rectangle</i>. Note that <tt>r.intersected(s)</tt> is equivalent to <tt>r &amp; s</tt>.</p>
<p class="centerAlign"><img src="images/qrect-intersect.png" alt="" /></p><p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qrect.html#intersects">intersects</a>(), <a href="qrect.html#united">united</a>(), and <a href="qrect.html#operator-and-eq">operator&amp;=</a>().</p>
<!-- @@@intersected -->
<!-- $$$intersects[overload1]$$$intersectsconstQRect& -->
<h3 class="fn"><a name="intersects"></a><span class="type">bool</span> QRect::<span class="name">intersects</span> ( const <span class="type">QRect</span> &amp; <i>rectangle</i> ) const</h3>
<p>Returns true if this rectangle intersects with the given <i>rectangle</i> (i.e&#x2e;, there is at least one pixel that is within both rectangles), otherwise returns false.</p>
<p>The intersection rectangle can be retrieved using the <a href="qrect.html#intersected">intersected</a>() function.</p>
<p><b>See also </b><a href="qrect.html#contains">contains</a>().</p>
<!-- @@@intersects -->
<!-- $$$isEmpty[overload1]$$$isEmpty -->
<h3 class="fn"><a name="isEmpty"></a><span class="type">bool</span> QRect::<span class="name">isEmpty</span> () const</h3>
<p>Returns true if the rectangle is empty, otherwise returns false.</p>
<p>An empty rectangle has a <a href="qrect.html#left">left</a>() &gt; <a href="qrect.html#right">right</a>() or <a href="qrect.html#top">top</a>() &gt; <a href="qrect.html#bottom">bottom</a>(). An empty rectangle is not valid (i.e&#x2e;, isEmpty() == !<a href="qrect.html#isValid">isValid</a>()).</p>
<p>Use the <a href="qrect.html#normalized">normalized</a>() function to retrieve a rectangle where the corners are swapped.</p>
<p><b>See also </b><a href="qrect.html#isNull">isNull</a>(), <a href="qrect.html#isValid">isValid</a>(), and <a href="qrect.html#normalized">normalized</a>().</p>
<!-- @@@isEmpty -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn"><a name="isNull"></a><span class="type">bool</span> QRect::<span class="name">isNull</span> () const</h3>
<p>Returns true if the rectangle is a null rectangle, otherwise returns false.</p>
<p>A null rectangle has both the width and the height set to 0 (i.e&#x2e;, <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). A null rectangle is also empty, and hence is not valid.</p>
<p><b>See also </b><a href="qrect.html#isEmpty">isEmpty</a>() and <a href="qrect.html#isValid">isValid</a>().</p>
<!-- @@@isNull -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn"><a name="isValid"></a><span class="type">bool</span> QRect::<span class="name">isValid</span> () const</h3>
<p>Returns true if the rectangle is valid, otherwise returns false.</p>
<p>A valid rectangle has a <a href="qrect.html#left">left</a>() &lt; <a href="qrect.html#right">right</a>() and <a href="qrect.html#top">top</a>() &lt; <a href="qrect.html#bottom">bottom</a>(). Note that non-trivial operations like intersections are not defined for invalid rectangles. A valid rectangle is not empty (i.e&#x2e;, isValid() == !<a href="qrect.html#isEmpty">isEmpty</a>()).</p>
<p><b>See also </b><a href="qrect.html#isNull">isNull</a>(), <a href="qrect.html#isEmpty">isEmpty</a>(), and <a href="qrect.html#normalized">normalized</a>().</p>
<!-- @@@isValid -->
<!-- $$$left[overload1]$$$left -->
<h3 class="fn"><a name="left"></a><span class="type">int</span> QRect::<span class="name">left</span> () const</h3>
<p>Returns the x-coordinate of the rectangle's left edge. Equivalent to <a href="qrect.html#x">x</a>().</p>
<p><b>See also </b><a href="qrect.html#setLeft">setLeft</a>(), <a href="qrect.html#topLeft">topLeft</a>(), and <a href="qrect.html#bottomLeft">bottomLeft</a>().</p>
<!-- @@@left -->
<!-- $$$moveBottom[overload1]$$$moveBottomint -->
<h3 class="fn"><a name="moveBottom"></a><span class="type">void</span> QRect::<span class="name">moveBottom</span> ( <span class="type">int</span> <i>y</i> )</h3>
<p>Moves the rectangle vertically, leaving the rectangle's bottom edge at the given <i>y</i> coordinate. The rectangle's size is unchanged.</p>
<p><b>See also </b><a href="qrect.html#bottom">bottom</a>(), <a href="qrect.html#setBottom">setBottom</a>(), and <a href="qrect.html#moveTop">moveTop</a>().</p>
<!-- @@@moveBottom -->
<!-- $$$moveBottomLeft[overload1]$$$moveBottomLeftconstQPoint& -->
<h3 class="fn"><a name="moveBottomLeft"></a><span class="type">void</span> QRect::<span class="name">moveBottomLeft</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>position</i> )</h3>
<p>Moves the rectangle, leaving the bottom-left corner at the given <i>position</i>. The rectangle's size is unchanged.</p>
<p><b>See also </b><a href="qrect.html#setBottomLeft">setBottomLeft</a>(), <a href="qrect.html#moveBottom">moveBottom</a>(), and <a href="qrect.html#moveLeft">moveLeft</a>().</p>
<!-- @@@moveBottomLeft -->
<!-- $$$moveBottomRight[overload1]$$$moveBottomRightconstQPoint& -->
<h3 class="fn"><a name="moveBottomRight"></a><span class="type">void</span> QRect::<span class="name">moveBottomRight</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>position</i> )</h3>
<p>Moves the rectangle, leaving the bottom-right corner at the given <i>position</i>. The rectangle's size is unchanged.</p>
<p><b>See also </b><a href="qrect.html#setBottomRight">setBottomRight</a>(), <a href="qrect.html#moveRight">moveRight</a>(), and <a href="qrect.html#moveBottom">moveBottom</a>().</p>
<!-- @@@moveBottomRight -->
<!-- $$$moveCenter[overload1]$$$moveCenterconstQPoint& -->
<h3 class="fn"><a name="moveCenter"></a><span class="type">void</span> QRect::<span class="name">moveCenter</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>position</i> )</h3>
<p>Moves the rectangle, leaving the center point at the given <i>position</i>. The rectangle's size is unchanged.</p>
<p><b>See also </b><a href="qrect.html#center">center</a>().</p>
<!-- @@@moveCenter -->
<!-- $$$moveLeft[overload1]$$$moveLeftint -->
<h3 class="fn"><a name="moveLeft"></a><span class="type">void</span> QRect::<span class="name">moveLeft</span> ( <span class="type">int</span> <i>x</i> )</h3>
<p>Moves the rectangle horizontally, leaving the rectangle's left edge at the given <i>x</i> coordinate. The rectangle's size is unchanged.</p>
<p><b>See also </b><a href="qrect.html#left">left</a>(), <a href="qrect.html#setLeft">setLeft</a>(), and <a href="qrect.html#moveRight">moveRight</a>().</p>
<!-- @@@moveLeft -->
<!-- $$$moveRight[overload1]$$$moveRightint -->
<h3 class="fn"><a name="moveRight"></a><span class="type">void</span> QRect::<span class="name">moveRight</span> ( <span class="type">int</span> <i>x</i> )</h3>
<p>Moves the rectangle horizontally, leaving the rectangle's right edge at the given <i>x</i> coordinate. The rectangle's size is unchanged.</p>
<p><b>See also </b><a href="qrect.html#right">right</a>(), <a href="qrect.html#setRight">setRight</a>(), and <a href="qrect.html#moveLeft">moveLeft</a>().</p>
<!-- @@@moveRight -->
<!-- $$$moveTo[overload1]$$$moveTointint -->
<h3 class="fn"><a name="moveTo"></a><span class="type">void</span> QRect::<span class="name">moveTo</span> ( <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i> )</h3>
<p>Moves the rectangle, leaving the top-left corner at the given position (<i>x</i>, <i>y</i>). The rectangle's size is unchanged.</p>
<p><b>See also </b><a href="qrect.html#translate">translate</a>() and <a href="qrect.html#moveTopLeft">moveTopLeft</a>().</p>
<!-- @@@moveTo -->
<!-- $$$moveTo$$$moveToconstQPoint& -->
<h3 class="fn"><a name="moveTo-2"></a><span class="type">void</span> QRect::<span class="name">moveTo</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>position</i> )</h3>
<p>Moves the rectangle, leaving the top-left corner at the given <i>position</i>.</p>
<!-- @@@moveTo -->
<!-- $$$moveTop[overload1]$$$moveTopint -->
<h3 class="fn"><a name="moveTop"></a><span class="type">void</span> QRect::<span class="name">moveTop</span> ( <span class="type">int</span> <i>y</i> )</h3>
<p>Moves the rectangle vertically, leaving the rectangle's top edge at the given <i>y</i> coordinate. The rectangle's size is unchanged.</p>
<p><b>See also </b><a href="qrect.html#top">top</a>(), <a href="qrect.html#setTop">setTop</a>(), and <a href="qrect.html#moveBottom">moveBottom</a>().</p>
<!-- @@@moveTop -->
<!-- $$$moveTopLeft[overload1]$$$moveTopLeftconstQPoint& -->
<h3 class="fn"><a name="moveTopLeft"></a><span class="type">void</span> QRect::<span class="name">moveTopLeft</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>position</i> )</h3>
<p>Moves the rectangle, leaving the top-left corner at the given <i>position</i>. The rectangle's size is unchanged.</p>
<p><b>See also </b><a href="qrect.html#setTopLeft">setTopLeft</a>(), <a href="qrect.html#moveTop">moveTop</a>(), and <a href="qrect.html#moveLeft">moveLeft</a>().</p>
<!-- @@@moveTopLeft -->
<!-- $$$moveTopRight[overload1]$$$moveTopRightconstQPoint& -->
<h3 class="fn"><a name="moveTopRight"></a><span class="type">void</span> QRect::<span class="name">moveTopRight</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>position</i> )</h3>
<p>Moves the rectangle, leaving the top-right corner at the given <i>position</i>. The rectangle's size is unchanged.</p>
<p><b>See also </b><a href="qrect.html#setTopRight">setTopRight</a>(), <a href="qrect.html#moveTop">moveTop</a>(), and <a href="qrect.html#moveRight">moveRight</a>().</p>
<!-- @@@moveTopRight -->
<!-- $$$normalized[overload1]$$$normalized -->
<h3 class="fn"><a name="normalized"></a><span class="type">QRect</span> QRect::<span class="name">normalized</span> () const</h3>
<p>Returns a normalized rectangle; i.e&#x2e;, a rectangle that has a non-negative width and height.</p>
<p>If <a href="qrect.html#width">width</a>() &lt; 0 the function swaps the left and right corners, and it swaps the top and bottom corners if <a href="qrect.html#height">height</a>() &lt; 0.</p>
<p><b>See also </b><a href="qrect.html#isValid">isValid</a>() and <a href="qrect.html#isEmpty">isEmpty</a>().</p>
<!-- @@@normalized -->
<!-- $$$right[overload1]$$$right -->
<h3 class="fn"><a name="right"></a><span class="type">int</span> QRect::<span class="name">right</span> () const</h3>
<p>Returns the x-coordinate of the rectangle's right edge.</p>
<p>Note that for historical reasons this function returns <a href="qrect.html#left">left</a>() + <a href="qrect.html#width">width</a>() - 1; use <a href="qrect.html#x">x</a>() + <a href="qrect.html#width">width</a>() to retrieve the true x-coordinate.</p>
<p><b>See also </b><a href="qrect.html#setRight">setRight</a>(), <a href="qrect.html#topRight">topRight</a>(), and <a href="qrect.html#bottomRight">bottomRight</a>().</p>
<!-- @@@right -->
<!-- $$$setBottom[overload1]$$$setBottomint -->
<h3 class="fn"><a name="setBottom"></a><span class="type">void</span> QRect::<span class="name">setBottom</span> ( <span class="type">int</span> <i>y</i> )</h3>
<p>Sets the bottom edge of the rectangle to the given <i>y</i> coordinate. May change the height, but will never change the top edge of the rectangle.</p>
<p><b>See also </b><a href="qrect.html#bottom">bottom</a>() and <a href="qrect.html#moveBottom">moveBottom</a>().</p>
<!-- @@@setBottom -->
<!-- $$$setBottomLeft[overload1]$$$setBottomLeftconstQPoint& -->
<h3 class="fn"><a name="setBottomLeft"></a><span class="type">void</span> QRect::<span class="name">setBottomLeft</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>position</i> )</h3>
<p>Set the bottom-left corner of the rectangle to the given <i>position</i>. May change the size, but will never change the top-right corner of the rectangle.</p>
<p><b>See also </b><a href="qrect.html#bottomLeft">bottomLeft</a>() and <a href="qrect.html#moveBottomLeft">moveBottomLeft</a>().</p>
<!-- @@@setBottomLeft -->
<!-- $$$setBottomRight[overload1]$$$setBottomRightconstQPoint& -->
<h3 class="fn"><a name="setBottomRight"></a><span class="type">void</span> QRect::<span class="name">setBottomRight</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>position</i> )</h3>
<p>Set the bottom-right corner of the rectangle to the given <i>position</i>. May change the size, but will never change the top-left corner of the rectangle.</p>
<p><b>See also </b><a href="qrect.html#bottomRight">bottomRight</a>() and <a href="qrect.html#moveBottomRight">moveBottomRight</a>().</p>
<!-- @@@setBottomRight -->
<!-- $$$setCoords[overload1]$$$setCoordsintintintint -->
<h3 class="fn"><a name="setCoords"></a><span class="type">void</span> QRect::<span class="name">setCoords</span> ( <span class="type">int</span> <i>x1</i>, <span class="type">int</span> <i>y1</i>, <span class="type">int</span> <i>x2</i>, <span class="type">int</span> <i>y2</i> )</h3>
<p>Sets the coordinates of the rectangle's top-left corner to (<i>x1</i>, <i>y1</i>), and the coordinates of its bottom-right corner to (<i>x2</i>, <i>y2</i>).</p>
<p><b>See also </b><a href="qrect-qt3.html#coords" class="compat">coords</a>(), <a href="qrect.html#getCoords">getCoords</a>(), and <a href="qrect.html#setRect">setRect</a>().</p>
<!-- @@@setCoords -->
<!-- $$$setHeight[overload1]$$$setHeightint -->
<h3 class="fn"><a name="setHeight"></a><span class="type">void</span> QRect::<span class="name">setHeight</span> ( <span class="type">int</span> <i>height</i> )</h3>
<p>Sets the height of the rectangle to the given <i>height</i>. The bottom edge is changed, but not the top one.</p>
<p><b>See also </b><a href="qrect.html#height">height</a>() and <a href="qrect.html#setSize">setSize</a>().</p>
<!-- @@@setHeight -->
<!-- $$$setLeft[overload1]$$$setLeftint -->
<h3 class="fn"><a name="setLeft"></a><span class="type">void</span> QRect::<span class="name">setLeft</span> ( <span class="type">int</span> <i>x</i> )</h3>
<p>Sets the left edge of the rectangle to the given <i>x</i> coordinate. May change the width, but will never change the right edge of the rectangle.</p>
<p>Equivalent to <a href="qrect.html#setX">setX</a>().</p>
<p><b>See also </b><a href="qrect.html#left">left</a>() and <a href="qrect.html#moveLeft">moveLeft</a>().</p>
<!-- @@@setLeft -->
<!-- $$$setRect[overload1]$$$setRectintintintint -->
<h3 class="fn"><a name="setRect"></a><span class="type">void</span> QRect::<span class="name">setRect</span> ( <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i> )</h3>
<p>Sets the coordinates of the rectangle's top-left corner to (<i>x</i>, <i>y</i>), and its size to the given <i>width</i> and <i>height</i>.</p>
<p><b>See also </b><a href="qrect-qt3.html#rect" class="compat">rect</a>(), <a href="qrect.html#getRect">getRect</a>(), and <a href="qrect.html#setCoords">setCoords</a>().</p>
<!-- @@@setRect -->
<!-- $$$setRight[overload1]$$$setRightint -->
<h3 class="fn"><a name="setRight"></a><span class="type">void</span> QRect::<span class="name">setRight</span> ( <span class="type">int</span> <i>x</i> )</h3>
<p>Sets the right edge of the rectangle to the given <i>x</i> coordinate. May change the width, but will never change the left edge of the rectangle.</p>
<p><b>See also </b><a href="qrect.html#right">right</a>() and <a href="qrect.html#moveRight">moveRight</a>().</p>
<!-- @@@setRight -->
<!-- $$$setSize[overload1]$$$setSizeconstQSize& -->
<h3 class="fn"><a name="setSize"></a><span class="type">void</span> QRect::<span class="name">setSize</span> ( const <span class="type"><a href="qsize.html">QSize</a></span> &amp; <i>size</i> )</h3>
<p>Sets the size of the rectangle to the given <i>size</i>. The top-left corner is not moved.</p>
<p><b>See also </b><a href="qrect.html#size">size</a>(), <a href="qrect.html#setWidth">setWidth</a>(), and <a href="qrect.html#setHeight">setHeight</a>().</p>
<!-- @@@setSize -->
<!-- $$$setTop[overload1]$$$setTopint -->
<h3 class="fn"><a name="setTop"></a><span class="type">void</span> QRect::<span class="name">setTop</span> ( <span class="type">int</span> <i>y</i> )</h3>
<p>Sets the top edge of the rectangle to the given <i>y</i> coordinate. May change the height, but will never change the bottom edge of the rectangle.</p>
<p>Equivalent to <a href="qrect.html#setY">setY</a>().</p>
<p><b>See also </b><a href="qrect.html#top">top</a>() and <a href="qrect.html#moveTop">moveTop</a>().</p>
<!-- @@@setTop -->
<!-- $$$setTopLeft[overload1]$$$setTopLeftconstQPoint& -->
<h3 class="fn"><a name="setTopLeft"></a><span class="type">void</span> QRect::<span class="name">setTopLeft</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>position</i> )</h3>
<p>Set the top-left corner of the rectangle to the given <i>position</i>. May change the size, but will never change the bottom-right corner of the rectangle.</p>
<p><b>See also </b><a href="qrect.html#topLeft">topLeft</a>() and <a href="qrect.html#moveTopLeft">moveTopLeft</a>().</p>
<!-- @@@setTopLeft -->
<!-- $$$setTopRight[overload1]$$$setTopRightconstQPoint& -->
<h3 class="fn"><a name="setTopRight"></a><span class="type">void</span> QRect::<span class="name">setTopRight</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>position</i> )</h3>
<p>Set the top-right corner of the rectangle to the given <i>position</i>. May change the size, but will never change the bottom-left corner of the rectangle.</p>
<p><b>See also </b><a href="qrect.html#topRight">topRight</a>() and <a href="qrect.html#moveTopRight">moveTopRight</a>().</p>
<!-- @@@setTopRight -->
<!-- $$$setWidth[overload1]$$$setWidthint -->
<h3 class="fn"><a name="setWidth"></a><span class="type">void</span> QRect::<span class="name">setWidth</span> ( <span class="type">int</span> <i>width</i> )</h3>
<p>Sets the width of the rectangle to the given <i>width</i>. The right edge is changed, but not the left one.</p>
<p><b>See also </b><a href="qrect.html#width">width</a>() and <a href="qrect.html#setSize">setSize</a>().</p>
<!-- @@@setWidth -->
<!-- $$$setX[overload1]$$$setXint -->
<h3 class="fn"><a name="setX"></a><span class="type">void</span> QRect::<span class="name">setX</span> ( <span class="type">int</span> <i>x</i> )</h3>
<p>Sets the left edge of the rectangle to the given <i>x</i> coordinate. May change the width, but will never change the right edge of the rectangle.</p>
<p>Equivalent to <a href="qrect.html#setLeft">setLeft</a>().</p>
<p><b>See also </b><a href="qrect.html#x">x</a>(), <a href="qrect.html#setY">setY</a>(), and <a href="qrect.html#setTopLeft">setTopLeft</a>().</p>
<!-- @@@setX -->
<!-- $$$setY[overload1]$$$setYint -->
<h3 class="fn"><a name="setY"></a><span class="type">void</span> QRect::<span class="name">setY</span> ( <span class="type">int</span> <i>y</i> )</h3>
<p>Sets the top edge of the rectangle to the given <i>y</i> coordinate. May change the height, but will never change the bottom edge of the rectangle.</p>
<p>Equivalent to <a href="qrect.html#setTop">setTop</a>().</p>
<p><b>See also </b><a href="qrect.html#y">y</a>(), <a href="qrect.html#setX">setX</a>(), and <a href="qrect.html#setTopLeft">setTopLeft</a>().</p>
<!-- @@@setY -->
<!-- $$$size[overload1]$$$size -->
<h3 class="fn"><a name="size"></a><span class="type"><a href="qsize.html">QSize</a></span> QRect::<span class="name">size</span> () const</h3>
<p>Returns the size of the rectangle.</p>
<p><b>See also </b><a href="qrect.html#setSize">setSize</a>(), <a href="qrect.html#width">width</a>(), and <a href="qrect.html#height">height</a>().</p>
<!-- @@@size -->
<!-- $$$top[overload1]$$$top -->
<h3 class="fn"><a name="top"></a><span class="type">int</span> QRect::<span class="name">top</span> () const</h3>
<p>Returns the y-coordinate of the rectangle's top edge. Equivalent to <a href="qrect.html#y">y</a>().</p>
<p><b>See also </b><a href="qrect.html#setTop">setTop</a>(), <a href="qrect.html#topLeft">topLeft</a>(), and <a href="qrect.html#topRight">topRight</a>().</p>
<!-- @@@top -->
<!-- $$$topLeft[overload1]$$$topLeft -->
<h3 class="fn"><a name="topLeft"></a><span class="type"><a href="qpoint.html">QPoint</a></span> QRect::<span class="name">topLeft</span> () const</h3>
<p>Returns the position of the rectangle's top-left corner.</p>
<p><b>See also </b><a href="qrect.html#setTopLeft">setTopLeft</a>(), <a href="qrect.html#top">top</a>(), and <a href="qrect.html#left">left</a>().</p>
<!-- @@@topLeft -->
<!-- $$$topRight[overload1]$$$topRight -->
<h3 class="fn"><a name="topRight"></a><span class="type"><a href="qpoint.html">QPoint</a></span> QRect::<span class="name">topRight</span> () const</h3>
<p>Returns the position of the rectangle's top-right corner.</p>
<p>Note that for historical reasons this function returns <a href="qpoint.html">QPoint</a>(<a href="qrect.html#left">left</a>() + <a href="qrect.html#width">width</a>() -1, <a href="qrect.html#top">top</a>()).</p>
<p><b>See also </b><a href="qrect.html#setTopRight">setTopRight</a>(), <a href="qrect.html#top">top</a>(), and <a href="qrect.html#right">right</a>().</p>
<!-- @@@topRight -->
<!-- $$$translate[overload1]$$$translateintint -->
<h3 class="fn"><a name="translate"></a><span class="type">void</span> QRect::<span class="name">translate</span> ( <span class="type">int</span> <i>dx</i>, <span class="type">int</span> <i>dy</i> )</h3>
<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>
<p><b>See also </b><a href="qrect.html#moveTopLeft">moveTopLeft</a>(), <a href="qrect.html#moveTo">moveTo</a>(), and <a href="qrect.html#translated">translated</a>().</p>
<!-- @@@translate -->
<!-- $$$translate$$$translateconstQPoint& -->
<h3 class="fn"><a name="translate-2"></a><span class="type">void</span> QRect::<span class="name">translate</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>offset</i> )</h3>
<p>This is an overloaded function.</p>
<p>Moves the rectangle <i>offset</i>.<a href="qpoint.html#x">x()</a> along the x axis and <i>offset</i>.<a href="qpoint.html#y">y()</a> along the y axis, relative to the current position.</p>
<!-- @@@translate -->
<!-- $$$translated[overload1]$$$translatedintint -->
<h3 class="fn"><a name="translated"></a><span class="type">QRect</span> QRect::<span class="name">translated</span> ( <span class="type">int</span> <i>dx</i>, <span class="type">int</span> <i>dy</i> ) const</h3>
<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>
<p><b>See also </b><a href="qrect.html#translate">translate</a>().</p>
<!-- @@@translated -->
<!-- $$$translated$$$translatedconstQPoint& -->
<h3 class="fn"><a name="translated-2"></a><span class="type">QRect</span> QRect::<span class="name">translated</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>offset</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns a copy of the rectangle that is translated <i>offset</i>.<a href="qpoint.html#x">x()</a> along the x axis and <i>offset</i>.<a href="qpoint.html#y">y()</a> along the y axis, relative to the current position.</p>
<!-- @@@translated -->
<!-- $$$united[overload1]$$$unitedconstQRect& -->
<h3 class="fn"><a name="united"></a><span class="type">QRect</span> QRect::<span class="name">united</span> ( const <span class="type">QRect</span> &amp; <i>rectangle</i> ) const</h3>
<p>Returns the bounding rectangle of this rectangle and the given <i>rectangle</i>.</p>
<p class="centerAlign"><img src="images/qrect-unite.png" alt="" /></p><p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qrect.html#intersected">intersected</a>().</p>
<!-- @@@united -->
<!-- $$$width[overload1]$$$width -->
<h3 class="fn"><a name="width"></a><span class="type">int</span> QRect::<span class="name">width</span> () const</h3>
<p>Returns the width of the rectangle.</p>
<p><b>See also </b><a href="qrect.html#setWidth">setWidth</a>(), <a href="qrect.html#height">height</a>(), and <a href="qrect.html#size">size</a>().</p>
<!-- @@@width -->
<!-- $$$x[overload1]$$$x -->
<h3 class="fn"><a name="x"></a><span class="type">int</span> QRect::<span class="name">x</span> () const</h3>
<p>Returns the x-coordinate of the rectangle's left edge. Equivalent to <a href="qrect.html#left">left</a>().</p>
<p><b>See also </b><a href="qrect.html#setX">setX</a>(), <a href="qrect.html#y">y</a>(), and <a href="qrect.html#topLeft">topLeft</a>().</p>
<!-- @@@x -->
<!-- $$$y[overload1]$$$y -->
<h3 class="fn"><a name="y"></a><span class="type">int</span> QRect::<span class="name">y</span> () const</h3>
<p>Returns the y-coordinate of the rectangle's top edge. Equivalent to <a href="qrect.html#top">top</a>().</p>
<p><b>See also </b><a href="qrect.html#setY">setY</a>(), <a href="qrect.html#x">x</a>(), and <a href="qrect.html#topLeft">topLeft</a>().</p>
<!-- @@@y -->
<!-- $$$operator&[overload1]$$$operator&constQRect& -->
<h3 class="fn"><a name="operator-and"></a><span class="type">QRect</span> QRect::<span class="name">operator&amp;</span> ( const <span class="type">QRect</span> &amp; <i>rectangle</i> ) const</h3>
<p>Returns the intersection of this rectangle and the given <i>rectangle</i>. Returns an empty rectangle if there is no intersection.</p>
<p><b>See also </b><a href="qrect.html#operator-and-eq">operator&amp;=</a>() and <a href="qrect.html#intersected">intersected</a>().</p>
<!-- @@@operator& -->
<!-- $$$operator&=[overload1]$$$operator&=constQRect& -->
<h3 class="fn"><a name="operator-and-eq"></a><span class="type">QRect</span> &amp; QRect::<span class="name">operator&amp;=</span> ( const <span class="type">QRect</span> &amp; <i>rectangle</i> )</h3>
<p>Intersects this rectangle with the given <i>rectangle</i>.</p>
<p><b>See also </b><a href="qrect.html#intersected">intersected</a>() and <a href="qrect.html#operator-and">operator&amp;</a>().</p>
<!-- @@@operator&= -->
<!-- $$$operator|[overload1]$$$operator|constQRect& -->
<h3 class="fn"><a name="operator-7c"></a><span class="type">QRect</span> QRect::<span class="name">operator|</span> ( const <span class="type">QRect</span> &amp; <i>rectangle</i> ) const</h3>
<p>Returns the bounding rectangle of this rectangle and the given <i>rectangle</i>.</p>
<p><b>See also </b><a href="qrect.html#operator-7c-eq">operator|=</a>() and <a href="qrect.html#united">united</a>().</p>
<!-- @@@operator| -->
<!-- $$$operator|=[overload1]$$$operator|=constQRect& -->
<h3 class="fn"><a name="operator-7c-eq"></a><span class="type">QRect</span> &amp; QRect::<span class="name">operator|=</span> ( const <span class="type">QRect</span> &amp; <i>rectangle</i> )</h3>
<p>Unites this rectangle with the given <i>rectangle</i>.</p>
<p><b>See also </b><a href="qrect.html#united">united</a>() and <a href="qrect.html#operator-7c">operator|</a>().</p>
<!-- @@@operator|= -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$operator!=$$$operator!=constQRect&constQRect& -->
<h3 class="fn"><a name="operator-not-eq-49"></a><span class="type">bool</span> <span class="name">operator!=</span> ( const <span class="type">QRect</span> &amp; <i>r1</i>, const <span class="type">QRect</span> &amp; <i>r2</i> )</h3>
<p>Returns true if the rectangles <i>r1</i> and <i>r2</i> are different, otherwise returns false.</p>
<!-- @@@operator!= -->
<!-- $$$operator<<$$$operator<<QDataStream&constQRect& -->
<h3 class="fn"><a name="operator-lt-lt-178"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <span class="name">operator&lt;&lt;</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>stream</i>, const <span class="type">QRect</span> &amp; <i>rectangle</i> )</h3>
<p>Writes the given <i>rectangle</i> to the given <i>stream</i>, and returns a reference to the stream.</p>
<p><b>See also </b><a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator<< -->
<!-- $$$operator==$$$operator==constQRect&constQRect& -->
<h3 class="fn"><a name="operator-eq-eq-73"></a><span class="type">bool</span> <span class="name">operator==</span> ( const <span class="type">QRect</span> &amp; <i>r1</i>, const <span class="type">QRect</span> &amp; <i>r2</i> )</h3>
<p>Returns true if the rectangles <i>r1</i> and <i>r2</i> are equal, otherwise returns false.</p>
<!-- @@@operator== -->
<!-- $$$operator>>$$$operator>>QDataStream&QRect& -->
<h3 class="fn"><a name="operator-gt-gt-98"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <span class="name">operator&gt;&gt;</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>stream</i>, <span class="type">QRect</span> &amp; <i>rectangle</i> )</h3>
<p>Reads a rectangle from the given <i>stream</i> into the given <i>rectangle</i>, and returns a reference to the stream.</p>
<p><b>See also </b><a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator>> -->
</div>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2012 Nokia Corporation and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      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.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>