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
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QRect Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </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="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QRect Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1><p>The QRect class defines a rectangle in the plane using integer
precision. <a href="#details">More...</a></p>
<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qrect.html#QRect">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qrect.html#QRect-2">__init__</a></b> (<i>self</i>, int <i>aleft</i>, int <i>atop</i>, int <i>awidth</i>, int <i>aheight</i>)</li><li><div class="fn" /><b><a href="qrect.html#QRect-3">__init__</a></b> (<i>self</i>, QPoint <i>atopLeft</i>, QPoint <i>abottomRight</i>)</li><li><div class="fn" /><b><a href="qrect.html#QRect-4">__init__</a></b> (<i>self</i>, QPoint <i>atopLeft</i>, QSize <i>asize</i>)</li><li><div class="fn" /><b><a href="qrect.html#QRect-5">__init__</a></b> (<i>self</i>, QRect)</li><li><div class="fn" /><b><a href="qrect.html#adjust">adjust</a></b> (<i>self</i>, int <i>dx1</i>, int <i>dy1</i>, int <i>dx2</i>, int <i>dy2</i>)</li><li><div class="fn" />QRect <b><a href="qrect.html#adjusted">adjusted</a></b> (<i>self</i>, int <i>xp1</i>, int <i>yp1</i>, int <i>xp2</i>, int <i>yp2</i>)</li><li><div class="fn" />int <b><a href="qrect.html#bottom">bottom</a></b> (<i>self</i>)</li><li><div class="fn" />QPoint <b><a href="qrect.html#bottomLeft">bottomLeft</a></b> (<i>self</i>)</li><li><div class="fn" />QPoint <b><a href="qrect.html#bottomRight">bottomRight</a></b> (<i>self</i>)</li><li><div class="fn" />QPoint <b><a href="qrect.html#center">center</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qrect.html#contains">contains</a></b> (<i>self</i>, QPoint <i>point</i>, bool <i>proper</i> = False)</li><li><div class="fn" />bool <b><a href="qrect.html#contains-2">contains</a></b> (<i>self</i>, QRect <i>rectangle</i>, bool <i>proper</i> = False)</li><li><div class="fn" />bool <b><a href="qrect.html#contains-3">contains</a></b> (<i>self</i>, int <i>ax</i>, int <i>ay</i>, bool <i>aproper</i>)</li><li><div class="fn" />bool <b><a href="qrect.html#contains-4">contains</a></b> (<i>self</i>, int <i>ax</i>, int <i>ay</i>)</li><li><div class="fn" />(int <i>xp1</i>, int <i>yp1</i>, int <i>xp2</i>, int <i>yp2</i>) <b><a href="qrect.html#getCoords">getCoords</a></b> (<i>self</i>)</li><li><div class="fn" />(int <i>ax</i>, int <i>ay</i>, int <i>aw</i>, int <i>ah</i>) <b><a href="qrect.html#getRect">getRect</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qrect.html#height">height</a></b> (<i>self</i>)</li><li><div class="fn" />QRect <b><a href="qrect.html#intersect">intersect</a></b> (<i>self</i>, QRect <i>r</i>)</li><li><div class="fn" />QRect <b><a href="qrect.html#intersected">intersected</a></b> (<i>self</i>, QRect <i>other</i>)</li><li><div class="fn" />bool <b><a href="qrect.html#intersects">intersects</a></b> (<i>self</i>, QRect <i>r</i>)</li><li><div class="fn" />bool <b><a href="qrect.html#isEmpty">isEmpty</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qrect.html#isNull">isNull</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qrect.html#isValid">isValid</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qrect.html#left">left</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qrect.html#moveBottom">moveBottom</a></b> (<i>self</i>, int <i>pos</i>)</li><li><div class="fn" /><b><a href="qrect.html#moveBottomLeft">moveBottomLeft</a></b> (<i>self</i>, QPoint <i>p</i>)</li><li><div class="fn" /><b><a href="qrect.html#moveBottomRight">moveBottomRight</a></b> (<i>self</i>, QPoint <i>p</i>)</li><li><div class="fn" /><b><a href="qrect.html#moveCenter">moveCenter</a></b> (<i>self</i>, QPoint <i>p</i>)</li><li><div class="fn" /><b><a href="qrect.html#moveLeft">moveLeft</a></b> (<i>self</i>, int <i>pos</i>)</li><li><div class="fn" /><b><a href="qrect.html#moveRight">moveRight</a></b> (<i>self</i>, int <i>pos</i>)</li><li><div class="fn" /><b><a href="qrect.html#moveTo">moveTo</a></b> (<i>self</i>, int <i>ax</i>, int <i>ay</i>)</li><li><div class="fn" /><b><a href="qrect.html#moveTo-2">moveTo</a></b> (<i>self</i>, QPoint <i>p</i>)</li><li><div class="fn" /><b><a href="qrect.html#moveTop">moveTop</a></b> (<i>self</i>, int <i>pos</i>)</li><li><div class="fn" /><b><a href="qrect.html#moveTopLeft">moveTopLeft</a></b> (<i>self</i>, QPoint <i>p</i>)</li><li><div class="fn" /><b><a href="qrect.html#moveTopRight">moveTopRight</a></b> (<i>self</i>, QPoint <i>p</i>)</li><li><div class="fn" />QRect <b><a href="qrect.html#normalized">normalized</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qrect.html#right">right</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qrect.html#setBottom">setBottom</a></b> (<i>self</i>, int <i>pos</i>)</li><li><div class="fn" /><b><a href="qrect.html#setBottomLeft">setBottomLeft</a></b> (<i>self</i>, QPoint <i>p</i>)</li><li><div class="fn" /><b><a href="qrect.html#setBottomRight">setBottomRight</a></b> (<i>self</i>, QPoint <i>p</i>)</li><li><div class="fn" /><b><a href="qrect.html#setCoords">setCoords</a></b> (<i>self</i>, int <i>xp1</i>, int <i>yp1</i>, int <i>xp2</i>, int <i>yp2</i>)</li><li><div class="fn" /><b><a href="qrect.html#setHeight">setHeight</a></b> (<i>self</i>, int <i>h</i>)</li><li><div class="fn" /><b><a href="qrect.html#setLeft">setLeft</a></b> (<i>self</i>, int <i>pos</i>)</li><li><div class="fn" /><b><a href="qrect.html#setRect">setRect</a></b> (<i>self</i>, int <i>ax</i>, int <i>ay</i>, int <i>aw</i>, int <i>ah</i>)</li><li><div class="fn" /><b><a href="qrect.html#setRight">setRight</a></b> (<i>self</i>, int <i>pos</i>)</li><li><div class="fn" /><b><a href="qrect.html#setSize">setSize</a></b> (<i>self</i>, QSize <i>s</i>)</li><li><div class="fn" /><b><a href="qrect.html#setTop">setTop</a></b> (<i>self</i>, int <i>pos</i>)</li><li><div class="fn" /><b><a href="qrect.html#setTopLeft">setTopLeft</a></b> (<i>self</i>, QPoint <i>p</i>)</li><li><div class="fn" /><b><a href="qrect.html#setTopRight">setTopRight</a></b> (<i>self</i>, QPoint <i>p</i>)</li><li><div class="fn" /><b><a href="qrect.html#setWidth">setWidth</a></b> (<i>self</i>, int <i>w</i>)</li><li><div class="fn" /><b><a href="qrect.html#setX">setX</a></b> (<i>self</i>, int <i>ax</i>)</li><li><div class="fn" /><b><a href="qrect.html#setY">setY</a></b> (<i>self</i>, int <i>ay</i>)</li><li><div class="fn" />QSize <b><a href="qrect.html#size">size</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qrect.html#top">top</a></b> (<i>self</i>)</li><li><div class="fn" />QPoint <b><a href="qrect.html#topLeft">topLeft</a></b> (<i>self</i>)</li><li><div class="fn" />QPoint <b><a href="qrect.html#topRight">topRight</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qrect.html#translate">translate</a></b> (<i>self</i>, int <i>dx</i>, int <i>dy</i>)</li><li><div class="fn" /><b><a href="qrect.html#translate-2">translate</a></b> (<i>self</i>, QPoint <i>p</i>)</li><li><div class="fn" />QRect <b><a href="qrect.html#translated">translated</a></b> (<i>self</i>, int <i>dx</i>, int <i>dy</i>)</li><li><div class="fn" />QRect <b><a href="qrect.html#translated-2">translated</a></b> (<i>self</i>, QPoint <i>p</i>)</li><li><div class="fn" />QRect <b><a href="qrect.html#unite">unite</a></b> (<i>self</i>, QRect <i>r</i>)</li><li><div class="fn" />QRect <b><a href="qrect.html#united">united</a></b> (<i>self</i>, QRect <i>r</i>)</li><li><div class="fn" />int <b><a href="qrect.html#width">width</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qrect.html#x">x</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qrect.html#y">y</a></b> (<i>self</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />QRect <b><a href="qrect.html#__and__">__and__</a></b> (<i>self</i>, QRect <i>r</i>)</li><li><div class="fn" />int <b><a href="qrect.html#__bool__">__bool__</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qrect.html#__contains__">__contains__</a></b> (<i>self</i>, QPoint <i>p</i>)</li><li><div class="fn" />int <b><a href="qrect.html#__contains__-2">__contains__</a></b> (<i>self</i>, QRect <i>r</i>)</li><li><div class="fn" />bool <b><a href="qrect.html#__eq__">__eq__</a></b> (<i>self</i>, QRect <i>r2</i>)</li><li><div class="fn" />QRect <b><a href="qrect.html#__iand__">__iand__</a></b> (<i>self</i>, QRect <i>r</i>)</li><li><div class="fn" />QRect <b><a href="qrect.html#__ior__">__ior__</a></b> (<i>self</i>, QRect <i>r</i>)</li><li><div class="fn" />bool <b><a href="qrect.html#__ne__">__ne__</a></b> (<i>self</i>, QRect <i>r2</i>)</li><li><div class="fn" />QRect <b><a href="qrect.html#__or__">__or__</a></b> (<i>self</i>, QRect <i>r</i>)</li><li><div class="fn" />object <b><a href="qrect.html#__repr__">__repr__</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>This class can be pickled.</p><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 class="odd" valign="top">
<td><img alt="" src="images/qrect-intersect.png" /></td>
<td><img alt="" src="images/qrect-unite.png" /></td>
</tr>
<tr class="even" valign="top">
<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>() > <a href="qrect.html#right">right</a>() or <a href="qrect.html#top">top</a>() > <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>() <= <a href="qrect.html#right">right</a>() <i>and</i> <a href="qrect.html#top">top</a>() <= <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 id="rendering" name="rendering" />
<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 class="odd" valign="top">
<td><img alt="" src="images/qrect-diagram-zero.png" /></td>
<td><img alt="" src="images/qrect-diagram-one.png" /></td>
</tr>
<tr class="even" valign="top">
<td>Logical representation</td>
<td>One pixel wide pen</td>
</tr>
<tr class="odd" valign="top">
<td><img alt="" src="images/qrect-diagram-two.png" /></td>
<td><img alt="" src="images/qrect-diagram-three.png" /></td>
</tr>
<tr class="even" valign="top">
<td>Two pixel wide pen</td>
<td>Three pixel wide pen</td>
</tr>
</table>
<a id="coordinates" name="coordinates" />
<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 alt="" src="images/qrect-coordinates.png" /></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>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QRect" />QRect.__init__ (<i>self</i>)</h3><p>Constructs a null rectangle.</p>
<p><b>See also</b> <a href="qrect.html#isNull">isNull</a>().</p>
<h3 class="fn"><a name="QRect-2" />QRect.__init__ (<i>self</i>, int <i>aleft</i>, int <i>atop</i>, int <i>awidth</i>, int <i>aheight</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>
<h3 class="fn"><a name="QRect-3" />QRect.__init__ (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>atopLeft</i>, <a href="qpoint.html">QPoint</a> <i>abottomRight</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>
<h3 class="fn"><a name="QRect-4" />QRect.__init__ (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>atopLeft</i>, <a href="qsize.html">QSize</a> <i>asize</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>
<h3 class="fn"><a name="QRect-5" />QRect.__init__ (<i>self</i>, <a href="qrect.html">QRect</a>)</h3><h3 class="fn"><a name="adjust" />QRect.adjust (<i>self</i>, int <i>dx1</i>, int <i>dy1</i>, int <i>dx2</i>, int <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>
<h3 class="fn"><a name="adjusted" /><a href="qrect.html">QRect</a> QRect.adjusted (<i>self</i>, int <i>xp1</i>, int <i>yp1</i>, int <i>xp2</i>, int <i>yp2</i>)</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>
<h3 class="fn"><a name="bottom" />int QRect.bottom (<i>self</i>)</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>
<h3 class="fn"><a name="bottomLeft" /><a href="qpoint.html">QPoint</a> QRect.bottomLeft (<i>self</i>)</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>
<h3 class="fn"><a name="bottomRight" /><a href="qpoint.html">QPoint</a> QRect.bottomRight (<i>self</i>)</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>
<h3 class="fn"><a name="center" /><a href="qpoint.html">QPoint</a> QRect.center (<i>self</i>)</h3><p>Returns the center point of the rectangle.</p>
<p><b>See also</b> <a href="qrect.html#moveCenter">moveCenter</a>().</p>
<h3 class="fn"><a name="contains" />bool QRect.contains (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>point</i>, bool <i>proper</i> = False)</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., not on the edge).</p>
<p><b>See also</b> <a href="qrect.html#intersects">intersects</a>().</p>
<h3 class="fn"><a name="contains-2" />bool QRect.contains (<i>self</i>, <a href="qrect.html">QRect</a> <i>rectangle</i>, bool <i>proper</i> = False)</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>
<h3 class="fn"><a name="contains-3" />bool QRect.contains (<i>self</i>, int <i>ax</i>, int <i>ay</i>, bool <i>aproper</i>)</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>
<h3 class="fn"><a name="contains-4" />bool QRect.contains (<i>self</i>, int <i>ax</i>, int <i>ay</i>)</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>
<h3 class="fn"><a name="getCoords" />(int <i>xp1</i>, int <i>yp1</i>, int <i>xp2</i>, int <i>yp2</i>) QRect.getCoords (<i>self</i>)</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>
<h3 class="fn"><a name="getRect" />(int <i>ax</i>, int <i>ay</i>, int <i>aw</i>, int <i>ah</i>) QRect.getRect (<i>self</i>)</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>
<h3 class="fn"><a name="height" />int QRect.height (<i>self</i>)</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>
<h3 class="fn"><a name="intersect" /><a href="qrect.html">QRect</a> QRect.intersect (<i>self</i>, <a href="qrect.html">QRect</a> <i>r</i>)</h3><h3 class="fn"><a name="intersected" /><a href="qrect.html">QRect</a> QRect.intersected (<i>self</i>, <a href="qrect.html">QRect</a> <i>other</i>)</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 & s</tt>.</p>
<p class="centerAlign"><img alt="" src="images/qrect-intersect.png" /></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&=</a>().</p>
<h3 class="fn"><a name="intersects" />bool QRect.intersects (<i>self</i>, <a href="qrect.html">QRect</a> <i>r</i>)</h3><p>Returns true if this rectangle intersects with the given
<i>rectangle</i> (i.e., 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>
<h3 class="fn"><a name="isEmpty" />bool QRect.isEmpty (<i>self</i>)</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>()
> <a href="qrect.html#right">right</a>() or <a href="qrect.html#top">top</a>() > <a href="qrect.html#bottom">bottom</a>(). An empty rectangle is not valid
(i.e., 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>
<h3 class="fn"><a name="isNull" />bool QRect.isNull (<i>self</i>)</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., <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>
<h3 class="fn"><a name="isValid" />bool QRect.isValid (<i>self</i>)</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>()
< <a href="qrect.html#right">right</a>() and <a href="qrect.html#top">top</a>() < <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., 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>
<h3 class="fn"><a name="left" />int QRect.left (<i>self</i>)</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>
<h3 class="fn"><a name="moveBottom" />QRect.moveBottom (<i>self</i>, int <i>pos</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>
<h3 class="fn"><a name="moveBottomLeft" />QRect.moveBottomLeft (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>p</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>
<h3 class="fn"><a name="moveBottomRight" />QRect.moveBottomRight (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>p</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>
<h3 class="fn"><a name="moveCenter" />QRect.moveCenter (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>p</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>
<h3 class="fn"><a name="moveLeft" />QRect.moveLeft (<i>self</i>, int <i>pos</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>
<h3 class="fn"><a name="moveRight" />QRect.moveRight (<i>self</i>, int <i>pos</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>
<h3 class="fn"><a name="moveTo" />QRect.moveTo (<i>self</i>, int <i>ax</i>, int <i>ay</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>
<h3 class="fn"><a name="moveTo-2" />QRect.moveTo (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>p</i>)</h3><p>Moves the rectangle, leaving the top-left corner at the given
<i>position</i>.</p>
<h3 class="fn"><a name="moveTop" />QRect.moveTop (<i>self</i>, int <i>pos</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>
<h3 class="fn"><a name="moveTopLeft" />QRect.moveTopLeft (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>p</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>
<h3 class="fn"><a name="moveTopRight" />QRect.moveTopRight (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>p</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>
<h3 class="fn"><a name="normalized" /><a href="qrect.html">QRect</a> QRect.normalized (<i>self</i>)</h3><p>Returns a normalized rectangle; i.e., a rectangle that has a
non-negative width and height.</p>
<p>If <a href="qrect.html#width">width</a>() < 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>() < 0.</p>
<p><b>See also</b> <a href="qrect.html#isValid">isValid</a>() and
<a href="qrect.html#isEmpty">isEmpty</a>().</p>
<h3 class="fn"><a name="right" />int QRect.right (<i>self</i>)</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>
<h3 class="fn"><a name="setBottom" />QRect.setBottom (<i>self</i>, int <i>pos</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>
<h3 class="fn"><a name="setBottomLeft" />QRect.setBottomLeft (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>p</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>
<h3 class="fn"><a name="setBottomRight" />QRect.setBottomRight (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>p</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>
<h3 class="fn"><a name="setCoords" />QRect.setCoords (<i>self</i>, int <i>xp1</i>, int <i>yp1</i>, int <i>xp2</i>, int <i>yp2</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 class="compat" href="qrect-qt3.html#coords">coords</a>(), <a href="qrect.html#getCoords">getCoords</a>(), and <a href="qrect.html#setRect">setRect</a>().</p>
<h3 class="fn"><a name="setHeight" />QRect.setHeight (<i>self</i>, int <i>h</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>
<h3 class="fn"><a name="setLeft" />QRect.setLeft (<i>self</i>, int <i>pos</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>
<h3 class="fn"><a name="setRect" />QRect.setRect (<i>self</i>, int <i>ax</i>, int <i>ay</i>, int <i>aw</i>, int <i>ah</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 class="compat" href="qrect-qt3.html#rect">rect</a>(), <a href="qrect.html#getRect">getRect</a>(),
and <a href="qrect.html#setCoords">setCoords</a>().</p>
<h3 class="fn"><a name="setRight" />QRect.setRight (<i>self</i>, int <i>pos</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>
<h3 class="fn"><a name="setSize" />QRect.setSize (<i>self</i>, <a href="qsize.html">QSize</a> <i>s</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>
<h3 class="fn"><a name="setTop" />QRect.setTop (<i>self</i>, int <i>pos</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>
<h3 class="fn"><a name="setTopLeft" />QRect.setTopLeft (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>p</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>
<h3 class="fn"><a name="setTopRight" />QRect.setTopRight (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>p</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>
<h3 class="fn"><a name="setWidth" />QRect.setWidth (<i>self</i>, int <i>w</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>
<h3 class="fn"><a name="setX" />QRect.setX (<i>self</i>, int <i>ax</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>
<h3 class="fn"><a name="setY" />QRect.setY (<i>self</i>, int <i>ay</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>
<h3 class="fn"><a name="size" /><a href="qsize.html">QSize</a> QRect.size (<i>self</i>)</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>
<h3 class="fn"><a name="top" />int QRect.top (<i>self</i>)</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>
<h3 class="fn"><a name="topLeft" /><a href="qpoint.html">QPoint</a> QRect.topLeft (<i>self</i>)</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>
<h3 class="fn"><a name="topRight" /><a href="qpoint.html">QPoint</a> QRect.topRight (<i>self</i>)</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>
<h3 class="fn"><a name="translate" />QRect.translate (<i>self</i>, int <i>dx</i>, int <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>
<h3 class="fn"><a name="translate-2" />QRect.translate (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>p</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>
<h3 class="fn"><a name="translated" /><a href="qrect.html">QRect</a> QRect.translated (<i>self</i>, int <i>dx</i>, int <i>dy</i>)</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>
<h3 class="fn"><a name="translated-2" /><a href="qrect.html">QRect</a> QRect.translated (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>p</i>)</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>
<h3 class="fn"><a name="unite" /><a href="qrect.html">QRect</a> QRect.unite (<i>self</i>, <a href="qrect.html">QRect</a> <i>r</i>)</h3><h3 class="fn"><a name="united" /><a href="qrect.html">QRect</a> QRect.united (<i>self</i>, <a href="qrect.html">QRect</a> <i>r</i>)</h3><p>Returns the bounding rectangle of this rectangle and the given
<i>rectangle</i>.</p>
<p class="centerAlign"><img alt="" src="images/qrect-unite.png" /></p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qrect.html#intersected">intersected</a>().</p>
<h3 class="fn"><a name="width" />int QRect.width (<i>self</i>)</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>
<h3 class="fn"><a name="x" />int QRect.x (<i>self</i>)</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>
<h3 class="fn"><a name="y" />int QRect.y (<i>self</i>)</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>
<h3 class="fn"><a name="__and__" /><a href="qrect.html">QRect</a> QRect.__and__ (<i>self</i>, <a href="qrect.html">QRect</a> <i>r</i>)</h3><h3 class="fn"><a name="__bool__" />int QRect.__bool__ (<i>self</i>)</h3><h3 class="fn"><a name="__contains__" />int QRect.__contains__ (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>p</i>)</h3><h3 class="fn"><a name="__contains__-2" />int QRect.__contains__ (<i>self</i>, <a href="qrect.html">QRect</a> <i>r</i>)</h3><h3 class="fn"><a name="__eq__" />bool QRect.__eq__ (<i>self</i>, <a href="qrect.html">QRect</a> <i>r2</i>)</h3><h3 class="fn"><a name="__iand__" /><a href="qrect.html">QRect</a> QRect.__iand__ (<i>self</i>, <a href="qrect.html">QRect</a> <i>r</i>)</h3><h3 class="fn"><a name="__ior__" /><a href="qrect.html">QRect</a> QRect.__ior__ (<i>self</i>, <a href="qrect.html">QRect</a> <i>r</i>)</h3><h3 class="fn"><a name="__ne__" />bool QRect.__ne__ (<i>self</i>, <a href="qrect.html">QRect</a> <i>r2</i>)</h3><h3 class="fn"><a name="__or__" /><a href="qrect.html">QRect</a> QRect.__or__ (<i>self</i>, <a href="qrect.html">QRect</a> <i>r</i>)</h3><h3 class="fn"><a name="__repr__" />object QRect.__repr__ (<i>self</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.12.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qt.io">The Qt Company</a> 2015</td><td align="right" width="25%">Qt 4.8.7</td></tr></table></div></address></body></html>
|