'\" t .TH TQRect 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 TQRect \- Defines a rectangle in the plane .SH SYNOPSIS \fC#include \fR .PP .SS "Public Members" .in +1c .ti -1c .BI "\fBTQRect\fR ()" .br .ti -1c .BI "\fBTQRect\fR ( const TQPoint & topLeft, const TQPoint & bottomRight )" .br .ti -1c .BI "\fBTQRect\fR ( const TQPoint & topLeft, const TQSize & size )" .br .ti -1c .BI "\fBTQRect\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 "TQRect \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 TQPoint & p )" .br .ti -1c .BI "void \fBsetBottomRight\fR ( const TQPoint & p )" .br .ti -1c .BI "void \fBsetTopRight\fR ( const TQPoint & p )" .br .ti -1c .BI "void \fBsetBottomLeft\fR ( const TQPoint & p )" .br .ti -1c .BI "TQPoint \fBtopLeft\fR () const" .br .ti -1c .BI "TQPoint \fBbottomRight\fR () const" .br .ti -1c .BI "TQPoint \fBtopRight\fR () const" .br .ti -1c .BI "TQPoint \fBbottomLeft\fR () const" .br .ti -1c .BI "TQPoint \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 TQPoint & p )" .br .ti -1c .BI "void \fBmoveBottomRight\fR ( const TQPoint & p )" .br .ti -1c .BI "void \fBmoveTopRight\fR ( const TQPoint & p )" .br .ti -1c .BI "void \fBmoveBottomLeft\fR ( const TQPoint & p )" .br .ti -1c .BI "void \fBmoveCenter\fR ( const TQPoint & 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 "TQRect \fBoperator|\fR ( const TQRect & r ) const" .br .ti -1c .BI "TQRect \fBoperator&\fR ( const TQRect & r ) const" .br .ti -1c .BI "TQRect & \fBoperator|=\fR ( const TQRect & r )" .br .ti -1c .BI "TQRect & \fBoperator&=\fR ( const TQRect & r )" .br .ti -1c .BI "bool \fBcontains\fR ( const TQPoint & 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 TQRect & r, bool proper = FALSE ) const" .br .ti -1c .BI "TQRect \fBunite\fR ( const TQRect & r ) const" .br .ti -1c .BI "TQRect \fBintersect\fR ( const TQRect & r ) const" .br .ti -1c .BI "bool \fBintersects\fR ( const TQRect & r ) const" .br .in -1c .SH RELATED FUNCTION DOCUMENTATION .in +1c .ti -1c .BI "bool \fBoperator==\fR ( const TQRect & r1, const TQRect & r2 )" .br .ti -1c .BI "bool \fBoperator!=\fR ( const TQRect & r1, const TQRect & r2 )" .br .ti -1c .BI "TQDataStream & \fBoperator<<\fR ( TQDataStream & s, const TQRect & r )" .br .ti -1c .BI "TQDataStream & \fBoperator>>\fR ( TQDataStream & s, TQRect & r )" .br .in -1c .SH DESCRIPTION The TQRect 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 tqwindowdefs.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 TQRect can be constructed with a set of left, top, width and height integers, from two TQPoints or from a TQPoint 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 TQRect contains a specific point with contains(). You can also test to see if two TQRects intersect with intersects() (see also intersect()). To get the bounding rectangle of two TQRects use unite(). .PP See also TQPoint, TQSize, Graphics Classes, and Image Processing Classes. .SH MEMBER FUNCTION DOCUMENTATION .SH "TQRect::TQRect ()" Constructs an invalid rectangle. .SH "TQRect::TQRect ( const TQPoint & topLeft, const TQPoint & bottomRight )" Constructs a rectangle with \fItopLeft\fR as the top-left corner and \fIbottomRight\fR as the bottom-right corner. .SH "TQRect::TQRect ( const TQPoint & topLeft, const TQSize & size )" Constructs a rectangle with \fItopLeft\fR as the top-left corner and \fIsize\fR as the rectangle size. .SH "TQRect::TQRect ( 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 TQRect r1( TQPoint(100,200), TQPoint(110,215) ); .br TQRect r2( TQPoint(100,200), TQSize(11,16) ); .br TQRect r3( 100, 200, 11, 16 ); .br .fi .SH "void TQRect::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 TQRect::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 "TQPoint TQRect::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 "TQPoint TQRect::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 "TQPoint TQRect::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 TQRect::contains ( const TQPoint & 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 TQRect::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 TQRect::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 TQRect::contains ( const TQRect & 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 TQRect::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 TQRect::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 "TQRect TQRect::intersect ( const TQRect & r ) const" Returns the intersection of this rectangle and rectangle \fIr\fR. \fCr.intersect(s)\fR is equivalent to \fCr&s\fR. .SH "bool TQRect::intersects ( const TQRect & 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 TQRect::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 TQRect::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 TQRect::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 TQRect::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 TQRect::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 TQRect::moveBottomLeft ( const TQPoint & 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 TQRect::moveBottomRight ( const TQPoint & 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 TQRect::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 TQRect::moveCenter ( const TQPoint & 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 TQRect::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 TQRect::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 TQRect::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 TQRect::moveTopLeft ( const TQPoint & 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 TQRect::moveTopRight ( const TQPoint & 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 "TQRect TQRect::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 "TQRect TQRect::operator& ( const TQRect & 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 "TQRect & TQRect::operator&= ( const TQRect & r )" Intersects this rectangle with rectangle \fIr\fR. .SH "TQRect TQRect::operator| ( const TQRect & 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 "TQRect & TQRect::operator|= ( const TQRect & r )" Unites this rectangle with rectangle \fIr\fR. .SH "QCOORD & TQRect::rBottom ()" Returns a reference to the bottom coordinate of the rectangle. .PP See also rLeft(), rTop(), and rRight(). .SH "QCOORD & TQRect::rLeft ()" Returns a reference to the left coordinate of the rectangle. .PP See also rTop(), rRight(), and rBottom(). .SH "QCOORD & TQRect::rRight ()" Returns a reference to the right coordinate of the rectangle. .PP See also rLeft(), rTop(), and rBottom(). .SH "QCOORD & TQRect::rTop ()" Returns a reference to the top coordinate of the rectangle. .PP See also rLeft(), rRight(), and rBottom(). .SH "void TQRect::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 TQRect::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 TQRect::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 TQRect::setBottomLeft ( const TQPoint & 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 TQRect::setBottomRight ( const TQPoint & 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 TQRect::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 TQRect::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 TQRect::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 TQRect::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 TQRect::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 TQRect::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 TQRect::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 TQRect::setTopLeft ( const TQPoint & 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 TQRect::setTopRight ( const TQPoint & 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 TQRect::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 TQRect::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 TQRect::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 TQRect::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 TQRect::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 "TQPoint TQRect::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 "TQPoint TQRect::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 "TQRect TQRect::unite ( const TQRect & 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 TQRect::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 TQRect::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 TQRect::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 TQRect & r1, const TQRect & r2 )" Returns TRUE if \fIr1\fR and \fIr2\fR are different; otherwise returns FALSE. .SH "TQDataStream & operator<< ( TQDataStream & s, const TQRect & r )" Writes the TQRect, \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 TQRect & r1, const TQRect & r2 )" Returns TRUE if \fIr1\fR and \fIr2\fR are equal; otherwise returns FALSE. .SH "TQDataStream & operator>> ( TQDataStream & s, TQRect & r )" Reads a TQRect 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/tqrect.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).