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
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
|
'\" t
.TH QRect 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QRect \- Defines a rectangle in the plane
.SH SYNOPSIS
\fC#include <ntqrect.h>\fR
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQRect\fR ()"
.br
.ti -1c
.BI "\fBQRect\fR ( const QPoint & topLeft, const QPoint & bottomRight )"
.br
.ti -1c
.BI "\fBQRect\fR ( const QPoint & topLeft, const TQSize & size )"
.br
.ti -1c
.BI "\fBQRect\fR ( int left, int top, int width, int height )"
.br
.ti -1c
.BI "bool \fBisNull\fR () const"
.br
.ti -1c
.BI "bool \fBisEmpty\fR () const"
.br
.ti -1c
.BI "bool \fBisValid\fR () const"
.br
.ti -1c
.BI "QRect \fBnormalize\fR () const"
.br
.ti -1c
.BI "int \fBleft\fR () const"
.br
.ti -1c
.BI "int \fBtop\fR () const"
.br
.ti -1c
.BI "int \fBright\fR () const"
.br
.ti -1c
.BI "int \fBbottom\fR () const"
.br
.ti -1c
.BI "QCOORD & \fBrLeft\fR ()"
.br
.ti -1c
.BI "QCOORD & \fBrTop\fR ()"
.br
.ti -1c
.BI "QCOORD & \fBrRight\fR ()"
.br
.ti -1c
.BI "QCOORD & \fBrBottom\fR ()"
.br
.ti -1c
.BI "int \fBx\fR () const"
.br
.ti -1c
.BI "int \fBy\fR () const"
.br
.ti -1c
.BI "void \fBsetLeft\fR ( int pos )"
.br
.ti -1c
.BI "void \fBsetTop\fR ( int pos )"
.br
.ti -1c
.BI "void \fBsetRight\fR ( int pos )"
.br
.ti -1c
.BI "void \fBsetBottom\fR ( int pos )"
.br
.ti -1c
.BI "void \fBsetX\fR ( int x )"
.br
.ti -1c
.BI "void \fBsetY\fR ( int y )"
.br
.ti -1c
.BI "void \fBsetTopLeft\fR ( const QPoint & p )"
.br
.ti -1c
.BI "void \fBsetBottomRight\fR ( const QPoint & p )"
.br
.ti -1c
.BI "void \fBsetTopRight\fR ( const QPoint & p )"
.br
.ti -1c
.BI "void \fBsetBottomLeft\fR ( const QPoint & p )"
.br
.ti -1c
.BI "QPoint \fBtopLeft\fR () const"
.br
.ti -1c
.BI "QPoint \fBbottomRight\fR () const"
.br
.ti -1c
.BI "QPoint \fBtopRight\fR () const"
.br
.ti -1c
.BI "QPoint \fBbottomLeft\fR () const"
.br
.ti -1c
.BI "QPoint \fBcenter\fR () const"
.br
.ti -1c
.BI "void \fBrect\fR ( int * x, int * y, int * w, int * h ) const"
.br
.ti -1c
.BI "void \fBcoords\fR ( int * xp1, int * yp1, int * xp2, int * yp2 ) const"
.br
.ti -1c
.BI "void \fBmoveLeft\fR ( int pos )"
.br
.ti -1c
.BI "void \fBmoveTop\fR ( int pos )"
.br
.ti -1c
.BI "void \fBmoveRight\fR ( int pos )"
.br
.ti -1c
.BI "void \fBmoveBottom\fR ( int pos )"
.br
.ti -1c
.BI "void \fBmoveTopLeft\fR ( const QPoint & p )"
.br
.ti -1c
.BI "void \fBmoveBottomRight\fR ( const QPoint & p )"
.br
.ti -1c
.BI "void \fBmoveTopRight\fR ( const QPoint & p )"
.br
.ti -1c
.BI "void \fBmoveBottomLeft\fR ( const QPoint & p )"
.br
.ti -1c
.BI "void \fBmoveCenter\fR ( const QPoint & p )"
.br
.ti -1c
.BI "void \fBmoveBy\fR ( int dx, int dy )"
.br
.ti -1c
.BI "void \fBsetRect\fR ( int x, int y, int w, int h )"
.br
.ti -1c
.BI "void \fBsetCoords\fR ( int xp1, int yp1, int xp2, int yp2 )"
.br
.ti -1c
.BI "void \fBaddCoords\fR ( int xp1, int yp1, int xp2, int yp2 )"
.br
.ti -1c
.BI "TQSize \fBsize\fR () const"
.br
.ti -1c
.BI "int \fBwidth\fR () const"
.br
.ti -1c
.BI "int \fBheight\fR () const"
.br
.ti -1c
.BI "void \fBsetWidth\fR ( int w )"
.br
.ti -1c
.BI "void \fBsetHeight\fR ( int h )"
.br
.ti -1c
.BI "void \fBsetSize\fR ( const TQSize & s )"
.br
.ti -1c
.BI "QRect \fBoperator|\fR ( const QRect & r ) const"
.br
.ti -1c
.BI "QRect \fBoperator&\fR ( const QRect & r ) const"
.br
.ti -1c
.BI "QRect & \fBoperator|=\fR ( const QRect & r )"
.br
.ti -1c
.BI "QRect & \fBoperator&=\fR ( const QRect & r )"
.br
.ti -1c
.BI "bool \fBcontains\fR ( const QPoint & p, bool proper = FALSE ) const"
.br
.ti -1c
.BI "bool \fBcontains\fR ( int x, int y ) const"
.br
.ti -1c
.BI "bool \fBcontains\fR ( int x, int y, bool proper ) const"
.br
.ti -1c
.BI "bool \fBcontains\fR ( const QRect & r, bool proper = FALSE ) const"
.br
.ti -1c
.BI "QRect \fBunite\fR ( const QRect & r ) const"
.br
.ti -1c
.BI "QRect \fBintersect\fR ( const QRect & r ) const"
.br
.ti -1c
.BI "bool \fBintersects\fR ( const QRect & r ) const"
.br
.in -1c
.SH RELATED FUNCTION DOCUMENTATION
.in +1c
.ti -1c
.BI "bool \fBoperator==\fR ( const QRect & r1, const QRect & r2 )"
.br
.ti -1c
.BI "bool \fBoperator!=\fR ( const QRect & r1, const QRect & r2 )"
.br
.ti -1c
.BI "TQDataStream & \fBoperator<<\fR ( TQDataStream & s, const QRect & r )"
.br
.ti -1c
.BI "TQDataStream & \fBoperator>>\fR ( TQDataStream & s, QRect & r )"
.br
.in -1c
.SH DESCRIPTION
The QRect class defines a rectangle in the plane.
.PP
A rectangle is internally represented as an upper-left corner and a bottom-right corner, but it is normally expressed as an upper-left corner and a size.
.PP
The coordinate type is QCOORD (defined in ntqwindowdefs.h as \fCint\fR). The minimum value of QCOORD is QCOORD_MIN (-2147483648) and the maximum value is QCOORD_MAX (2147483647).
.PP
Note that the size (width and height) of a rectangle might be different from what you are used to. If the top-left corner and the bottom-right corner are the same, the height and the width of the rectangle will both be 1.
.PP
Generally, \fIwidth = right - left + 1\fR and \fIheight = bottom - top + 1\fR. We designed it this way to make it correspond to rectangular spaces used by drawing functions in which the width and height denote a number of pixels. For example, drawing a rectangle with width and height 1 draws a single pixel.
.PP
The default coordinate system has origin (0, 0) in the top-left corner. The positive direction of the y axis is down, and the positive x axis is from left to right.
.PP
A QRect can be constructed with a set of left, top, width and height integers, from two QPoints or from a QPoint and a TQSize. After creation the dimensions can be changed, e.g. with setLeft(), setRight(), setTop() and setBottom(), or by setting sizes, e.g. setWidth(), setHeight() and setSize(). The dimensions can also be changed with the move functions, e.g. moveBy(), moveCenter(), moveBottomRight(), etc. You can also add coordinates to a rectangle with addCoords().
.PP
You can test to see if a QRect contains a specific point with contains(). You can also test to see if two QRects intersect with intersects() (see also intersect()). To get the bounding rectangle of two QRects use unite().
.PP
See also QPoint, TQSize, Graphics Classes, and Image Processing Classes.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QRect::QRect ()"
Constructs an invalid rectangle.
.SH "QRect::QRect ( const QPoint & topLeft, const QPoint & bottomRight )"
Constructs a rectangle with \fItopLeft\fR as the top-left corner and \fIbottomRight\fR as the bottom-right corner.
.SH "QRect::QRect ( const QPoint & topLeft, const TQSize & size )"
Constructs a rectangle with \fItopLeft\fR as the top-left corner and \fIsize\fR as the rectangle size.
.SH "QRect::QRect ( int left, int top, int width, int height )"
Constructs a rectangle with the \fItop\fR, \fIleft\fR corner and \fIwidth\fR and \fIheight\fR.
.PP
Example (creates three identical rectangles):
.PP
.nf
.br
QRect r1( QPoint(100,200), QPoint(110,215) );
.br
QRect r2( QPoint(100,200), TQSize(11,16) );
.br
QRect r3( 100, 200, 11, 16 );
.br
.fi
.SH "void QRect::addCoords ( int xp1, int yp1, int xp2, int yp2 )"
Adds \fIxp1\fR, \fIyp1\fR, \fIxp2\fR and \fIyp2\fR respectively to the existing coordinates of the rectangle.
.PP
Examples:
.)l multiple/ax1.h and multiple/ax2.h.
.SH "int QRect::bottom () const"
Returns the bottom coordinate of the rectangle.
.PP
See also setBottom(), top(), bottomLeft(), and bottomRight().
.PP
Examples:
.)l action/application.cpp, application/application.cpp, desktop/desktop.cpp, helpviewer/helpwindow.cpp, qfd/fontdisplayer.cpp, scribble/scribble.cpp, and themes/wood.cpp.
.SH "QPoint QRect::bottomLeft () const"
Returns the bottom-left position of the rectangle.
.PP
See also setBottomLeft(), moveBottomLeft(), topRight(), bottom(), and left().
.PP
Example: tictac/tictac.cpp.
.SH "QPoint QRect::bottomRight () const"
Returns the bottom-right position of the rectangle.
.PP
See also setBottomRight(), moveBottomRight(), topLeft(), right(), and bottom().
.PP
Example: tictac/tictac.cpp.
.SH "QPoint QRect::center () const"
Returns the center point of the rectangle.
.PP
See also moveCenter(), topLeft(), bottomRight(), topRight(), and bottomLeft().
.PP
Example: tooltip/tooltip.cpp.
.SH "bool QRect::contains ( const QPoint & p, bool proper = FALSE ) const"
Returns TRUE if the point \fIp\fR is inside or on the edge of the rectangle; otherwise returns FALSE.
.PP
If \fIproper\fR is TRUE, this function returns TRUE only if \fIp\fR is inside (not on the edge).
.PP
Example: t14/cannon.cpp.
.SH "bool QRect::contains ( int x, int y ) const"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the point \fIx\fR, \fIy\fR is inside this rectangle; otherwise returns FALSE.
.SH "bool QRect::contains ( int x, int y, bool proper ) const"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the point \fIx\fR, \fIy\fR is inside this rectangle; otherwise returns FALSE.
.PP
If \fIproper\fR is TRUE, this function returns TRUE only if the point is entirely inside (not on the edge).
.SH "bool QRect::contains ( const QRect & r, bool proper = FALSE ) const"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the rectangle \fIr\fR is inside this rectangle; otherwise returns FALSE.
.PP
If \fIproper\fR is TRUE, this function returns TRUE only if \fIr\fR is entirely inside (not on the edge).
.PP
See also unite(), intersect(), and intersects().
.SH "void QRect::coords ( int * xp1, int * yp1, int * xp2, int * yp2 ) const"
Extracts the rectangle parameters as the top-left point \fI*xp1\fR, \fI*yp1\fR and the bottom-right point \fI*xp2\fR, \fI*yp2\fR.
.PP
See also setCoords() and rect().
.PP
Examples:
.)l themes/metal.cpp and themes/wood.cpp.
.SH "int QRect::height () const"
Returns the height of the rectangle. The height includes both the top and bottom edges, i.e. height = bottom - top + 1.
.PP
See also width(), size(), and setHeight().
.PP
Examples:
.)l aclock/aclock.cpp, desktop/desktop.cpp, movies/main.cpp, scribble/scribble.cpp, themes/metal.cpp, themes/wood.cpp, and xform/xform.cpp.
.SH "QRect QRect::intersect ( const QRect & r ) const"
Returns the intersection of this rectangle and rectangle \fIr\fR. \fCr.intersect(s)\fR is equivalent to \fCr&s\fR.
.SH "bool QRect::intersects ( const QRect & r ) const"
Returns TRUE if this rectangle intersects with rectangle \fIr\fR (there is at least one pixel that is within both rectangles); otherwise returns FALSE.
.PP
See also intersect() and contains().
.PP
Examples:
.)l t11/cannon.cpp, t12/cannon.cpp, t13/cannon.cpp, and t14/cannon.cpp.
.SH "bool QRect::isEmpty () const"
Returns TRUE if the rectangle is empty; otherwise returns FALSE.
.PP
An empty rectangle has a left() > right() or top() > bottom().
.PP
An empty rectangle is not valid. \fCisEmpty() == !isValid()\fR
.PP
See also isNull(), isValid(), and normalize().
.SH "bool QRect::isNull () const"
Returns TRUE if the rectangle is a null rectangle; otherwise returns FALSE.
.PP
A null rectangle has both the width and the height set to 0, that is right() == left() - 1 and bottom() == top() - 1.
.PP
Note that if right() == left() and bottom() == top(), then the rectangle has width 1 and height 1.
.PP
A null rectangle is also empty.
.PP
A null rectangle is not valid.
.PP
See also isEmpty() and isValid().
.SH "bool QRect::isValid () const"
Returns TRUE if the rectangle is valid; otherwise returns FALSE.
.PP
A valid rectangle has a left() <= right() and top() <= bottom().
.PP
Note that non-trivial operations like intersections are not defined for invalid rectangles.
.PP
\fCisValid() == !isEmpty()\fR
.PP
See also isNull(), isEmpty(), and normalize().
.PP
Examples:
.)l themes/metal.cpp and tooltip/tooltip.cpp.
.SH "int QRect::left () const"
Returns the left coordinate of the rectangle. Identical to x().
.PP
See also setLeft(), right(), topLeft(), and bottomLeft().
.PP
Examples:
.)l aclock/aclock.cpp, desktop/desktop.cpp, i18n/main.cpp, scribble/scribble.cpp, tictac/tictac.cpp, and xform/xform.cpp.
.SH "void QRect::moveBottom ( int pos )"
Sets the bottom position of the rectangle to \fIpos\fR, leaving the size unchanged.
.PP
See also bottom(), setBottom(), moveLeft(), moveTop(), and moveRight().
.SH "void QRect::moveBottomLeft ( const QPoint & p )"
Sets the bottom-left position of the rectangle to \fIp\fR, leaving the size unchanged.
.PP
See also bottomLeft(), setBottomLeft(), moveTopLeft(), moveBottomRight(), and moveTopRight().
.PP
Example: t10/cannon.cpp.
.SH "void QRect::moveBottomRight ( const QPoint & p )"
Sets the bottom-right position of the rectangle to \fIp\fR, leaving the size unchanged.
.PP
See also bottomRight(), setBottomRight(), moveTopLeft(), moveTopRight(), and moveBottomLeft().
.SH "void QRect::moveBy ( int dx, int dy )"
Moves the rectangle \fIdx\fR along the x axis and \fIdy\fR along the y axis, relative to the current position. Positive values move the rectangle to the right and down.
.PP
See also moveTopLeft().
.PP
Examples:
.)l action/application.cpp, application/application.cpp, helpviewer/helpwindow.cpp, mdi/application.cpp, themes/wood.cpp, and xform/xform.cpp.
.SH "void QRect::moveCenter ( const QPoint & p )"
Sets the center point of the rectangle to \fIp\fR, leaving the size unchanged.
.PP
See also center(), moveTopLeft(), moveBottomRight(), moveTopRight(), and moveBottomLeft().
.PP
Examples:
.)l t11/cannon.cpp and t12/cannon.cpp.
.SH "void QRect::moveLeft ( int pos )"
Sets the left position of the rectangle to \fIpos\fR, leaving the size unchanged.
.PP
See also left(), setLeft(), moveTop(), moveRight(), and moveBottom().
.SH "void QRect::moveRight ( int pos )"
Sets the right position of the rectangle to \fIpos\fR, leaving the size unchanged.
.PP
See also right(), setRight(), moveLeft(), moveTop(), and moveBottom().
.SH "void QRect::moveTop ( int pos )"
Sets the top position of the rectangle to \fIpos\fR, leaving the size unchanged.
.PP
See also top(), setTop(), moveLeft(), moveRight(), and moveBottom().
.SH "void QRect::moveTopLeft ( const QPoint & p )"
Sets the top-left position of the rectangle to \fIp\fR, leaving the size unchanged.
.PP
See also topLeft(), setTopLeft(), moveBottomRight(), moveTopRight(), and moveBottomLeft().
.PP
Examples:
.)l helpsystem/tooltip.cpp and xform/xform.cpp.
.SH "void QRect::moveTopRight ( const QPoint & p )"
Sets the top-right position of the rectangle to \fIp\fR, leaving the size unchanged.
.PP
See also topRight(), setTopRight(), moveTopLeft(), moveBottomRight(), and moveBottomLeft().
.SH "QRect QRect::normalize () const"
Returns a normalized rectangle, i.e. a rectangle that has a non-negative width and height.
.PP
It swaps left and right if left() > right(), and swaps top and bottom if top() > bottom().
.PP
See also isValid().
.PP
Example: scribble/scribble.cpp.
.SH "QRect QRect::operator& ( const QRect & r ) const"
Returns the intersection of this rectangle and rectangle \fIr\fR.
.PP
Returns an empty rectangle if there is no intersection.
.PP
See also operator&=(), operator|(), isEmpty(), intersects(), and contains().
.SH "QRect & QRect::operator&= ( const QRect & r )"
Intersects this rectangle with rectangle \fIr\fR.
.SH "QRect QRect::operator| ( const QRect & r ) const"
Returns the bounding rectangle of this rectangle and rectangle \fIr\fR.
.PP
The bounding rectangle of a nonempty rectangle and an empty or invalid rectangle is defined to be the nonempty rectangle.
.PP
See also operator|=(), operator&(), intersects(), and contains().
.SH "QRect & QRect::operator|= ( const QRect & r )"
Unites this rectangle with rectangle \fIr\fR.
.SH "QCOORD & QRect::rBottom ()"
Returns a reference to the bottom coordinate of the rectangle.
.PP
See also rLeft(), rTop(), and rRight().
.SH "QCOORD & QRect::rLeft ()"
Returns a reference to the left coordinate of the rectangle.
.PP
See also rTop(), rRight(), and rBottom().
.SH "QCOORD & QRect::rRight ()"
Returns a reference to the right coordinate of the rectangle.
.PP
See also rLeft(), rTop(), and rBottom().
.SH "QCOORD & QRect::rTop ()"
Returns a reference to the top coordinate of the rectangle.
.PP
See also rLeft(), rRight(), and rBottom().
.SH "void QRect::rect ( int * x, int * y, int * w, int * h ) const"
Extracts the rectangle parameters as the position \fI*x\fR, \fI*y\fR and width \fI*w\fR and height \fI*h\fR.
.PP
See also setRect() and coords().
.PP
Examples:
.)l themes/metal.cpp and themes/wood.cpp.
.SH "int QRect::right () const"
Returns the right coordinate of the rectangle.
.PP
See also setRight(), left(), topRight(), and bottomRight().
.PP
Examples:
.)l action/application.cpp, application/application.cpp, customlayout/flow.cpp, desktop/desktop.cpp, scribble/scribble.cpp, t11/cannon.cpp, and themes/wood.cpp.
.SH "void QRect::setBottom ( int pos )"
Sets the bottom edge of the rectangle to \fIpos\fR. May change the height, but will never change the top edge of the rectangle.
.PP
See also bottom(), setTop(), and setHeight().
.PP
Example: scribble/scribble.cpp.
.SH "void QRect::setBottomLeft ( const QPoint & p )"
Set the bottom-left corner of the rectangle to \fIp\fR. May change the size, but will the never change the top-right corner of the rectangle.
.PP
See also bottomLeft(), moveBottomLeft(), setTopLeft(), setBottomRight(), and setTopRight().
.SH "void QRect::setBottomRight ( const QPoint & p )"
Set the bottom-right corner of the rectangle to \fIp\fR. May change the size, but will the never change the top-left corner of the rectangle.
.PP
See also bottomRight(), moveBottomRight(), setTopLeft(), setTopRight(), and setBottomLeft().
.SH "void QRect::setCoords ( int xp1, int yp1, int xp2, int yp2 )"
Sets the coordinates of the rectangle's top-left corner to \fI(xp1, yp1)\fR, and the coordinates of its bottom-right corner to \fI(xp2, yp2)\fR.
.PP
See also coords() and setRect().
.SH "void QRect::setHeight ( int h )"
Sets the height of the rectangle to \fIh\fR. The top edge is not moved, but the bottom edge may be moved.
.PP
See also height(), setTop(), setBottom(), and setSize().
.PP
Example: desktop/desktop.cpp.
.SH "void QRect::setLeft ( int pos )"
Sets the left edge of the rectangle to \fIpos\fR. May change the width, but will never change the right edge of the rectangle.
.PP
Identical to setX().
.PP
See also left(), setTop(), and setWidth().
.PP
Example: scribble/scribble.cpp.
.SH "void QRect::setRect ( int x, int y, int w, int h )"
Sets the coordinates of the rectangle's top-left corner to \fI(x, y)\fR, and its size to \fI(w, h)\fR.
.PP
See also rect() and setCoords().
.PP
Example: themes/wood.cpp.
.SH "void QRect::setRight ( int pos )"
Sets the right edge of the rectangle to \fIpos\fR. May change the width, but will never change the left edge of the rectangle.
.PP
See also right(), setLeft(), and setWidth().
.PP
Example: scribble/scribble.cpp.
.SH "void QRect::setSize ( const TQSize & s )"
Sets the size of the rectangle to \fIs\fR. The top-left corner is not moved.
.PP
See also size(), setWidth(), and setHeight().
.PP
Example: xform/xform.cpp.
.SH "void QRect::setTop ( int pos )"
Sets the top edge of the rectangle to \fIpos\fR. May change the height, but will never change the bottom edge of the rectangle.
.PP
Identical to setY().
.PP
See also top(), setBottom(), and setHeight().
.PP
Example: scribble/scribble.cpp.
.SH "void QRect::setTopLeft ( const QPoint & p )"
Set the top-left corner of the rectangle to \fIp\fR. May change the size, but will the never change the bottom-right corner of the rectangle.
.PP
See also topLeft(), moveTopLeft(), setBottomRight(), setTopRight(), and setBottomLeft().
.SH "void QRect::setTopRight ( const QPoint & p )"
Set the top-right corner of the rectangle to \fIp\fR. May change the size, but will the never change the bottom-left corner of the rectangle.
.PP
See also topRight(), moveTopRight(), setTopLeft(), setBottomRight(), and setBottomLeft().
.SH "void QRect::setWidth ( int w )"
Sets the width of the rectangle to \fIw\fR. The right edge is changed, but not the left edge.
.PP
See also width(), setLeft(), setRight(), and setSize().
.PP
Example: desktop/desktop.cpp.
.SH "void QRect::setX ( int x )"
Sets the x position of the rectangle (its left end) to \fIx\fR. May change the width, but will never change the right edge of the rectangle.
.PP
Identical to setLeft().
.PP
See also x() and setY().
.SH "void QRect::setY ( int y )"
Sets the y position of the rectangle (its top) to \fIy\fR. May change the height, but will never change the bottom edge of the rectangle.
.PP
Identical to setTop().
.PP
See also y() and setX().
.SH "TQSize QRect::size () const"
Returns the size of the rectangle.
.PP
See also width() and height().
.PP
Examples:
.)l desktop/desktop.cpp, movies/main.cpp, and t10/cannon.cpp.
.SH "int QRect::top () const"
Returns the top coordinate of the rectangle. Identical to y().
.PP
See also setTop(), bottom(), topLeft(), and topRight().
.PP
Examples:
.)l aclock/aclock.cpp, desktop/desktop.cpp, scribble/scribble.cpp, themes/wood.cpp, tictac/tictac.cpp, and xform/xform.cpp.
.SH "QPoint QRect::topLeft () const"
Returns the top-left position of the rectangle.
.PP
See also setTopLeft(), moveTopLeft(), bottomRight(), left(), and top().
.PP
Examples:
.)l helpsystem/tooltip.cpp, t10/cannon.cpp, and tictac/tictac.cpp.
.SH "QPoint QRect::topRight () const"
Returns the top-right position of the rectangle.
.PP
See also setTopRight(), moveTopRight(), bottomLeft(), top(), and right().
.PP
Example: tictac/tictac.cpp.
.SH "QRect QRect::unite ( const QRect & r ) const"
Returns the bounding rectangle of this rectangle and rectangle \fIr\fR. \fCr.unite(s)\fR is equivalent to \fCr|s\fR.
.PP
Examples:
.)l t11/cannon.cpp, t12/cannon.cpp, and xform/xform.cpp.
.SH "int QRect::width () const"
Returns the width of the rectangle. The width includes both the left and right edges, i.e. width = right - left + 1.
.PP
See also height(), size(), and setHeight().
.PP
Examples:
.)l aclock/aclock.cpp, customlayout/border.cpp, desktop/desktop.cpp, movies/main.cpp, themes/metal.cpp, themes/wood.cpp, and xform/xform.cpp.
.SH "int QRect::x () const"
Returns the left coordinate of the rectangle. Identical to left().
.PP
See also left(), y(), and setX().
.PP
Examples:
.)l customlayout/border.cpp, desktop/desktop.cpp, movies/main.cpp, scribble/scribble.cpp, t12/cannon.cpp, themes/metal.cpp, and themes/wood.cpp.
.SH "int QRect::y () const"
Returns the top coordinate of the rectangle. Identical to top().
.PP
See also top(), x(), and setY().
.PP
Examples:
.)l desktop/desktop.cpp, movies/main.cpp, scribble/scribble.cpp, t12/cannon.cpp, t14/cannon.cpp, themes/metal.cpp, and themes/wood.cpp.
.SH RELATED FUNCTION DOCUMENTATION
.SH "bool operator!= ( const QRect & r1, const QRect & r2 )"
Returns TRUE if \fIr1\fR and \fIr2\fR are different; otherwise returns FALSE.
.SH "TQDataStream & operator<< ( TQDataStream & s, const QRect & r )"
Writes the QRect, \fIr\fR, to the stream \fIs\fR, and returns a reference to the stream.
.PP
See also Format of the TQDataStream operators.
.SH "bool operator== ( const QRect & r1, const QRect & r2 )"
Returns TRUE if \fIr1\fR and \fIr2\fR are equal; otherwise returns FALSE.
.SH "TQDataStream & operator>> ( TQDataStream & s, QRect & r )"
Reads a QRect from the stream \fIs\fR into rect \fIr\fR and returns a reference to the stream.
.PP
See also Format of the TQDataStream operators.
.SH "SEE ALSO"
.BR http://doc.trolltech.com/ntqrect.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqrect.3qt) and the Qt
version (3.3.8).
|