📄 qrect.3qt
字号:
.)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..PPSee also intersect() and contains()..PPExamples:.)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..PPAn empty rectangle has a left() > right() or top() > bottom()..PPAn empty rectangle is not valid. \fCisEmpty() == !isValid()\fR.PPSee also isNull(), isValid(), and normalize()..SH "bool QRect::isNull () const"Returns TRUE if the rectangle is a null rectangle; otherwise returns FALSE..PPA null rectangle has both the width and the height set to 0, that is right() == left() - 1 and bottom() == top() - 1..PPNote that if right() == left() and bottom() == top(), then the rectangle has width 1 and height 1..PPA null rectangle is also empty..PPA null rectangle is not valid..PPSee also isEmpty() and isValid()..SH "bool QRect::isValid () const"Returns TRUE if the rectangle is valid; otherwise returns FALSE..PPA valid rectangle has a left() <= right() and top() <= bottom()..PPNote that non-trivial operations like intersections are not defined for invalid rectangles..PP\fCisValid() == !isEmpty()\fR.PPSee also isNull(), isEmpty(), and normalize()..PPExamples:.)l themes/metal.cpp and tooltip/tooltip.cpp..SH "int QRect::left () const"Returns the left coordinate of the rectangle. Identical to x()..PPSee also setLeft(), right(), topLeft(), and bottomLeft()..PPExamples:.)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..PPSee 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..PPSee also bottomLeft(), setBottomLeft(), moveTopLeft(), moveBottomRight(), and moveTopRight()..PPExample: 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..PPSee 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..PPSee also moveTopLeft()..PPExamples:.)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..PPSee also center(), moveTopLeft(), moveBottomRight(), moveTopRight(), and moveBottomLeft()..PPExamples:.)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..PPSee 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..PPSee 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..PPSee 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..PPSee also topLeft(), setTopLeft(), moveBottomRight(), moveTopRight(), and moveBottomLeft()..PPExamples:.)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..PPSee 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..PPIt swaps left and right if left() > right(), and swaps top and bottom if top() > bottom()..PPSee also isValid()..PPExample: scribble/scribble.cpp..SH "QRect QRect::operator& ( const QRect & r ) const"Returns the intersection of this rectangle and rectangle \fIr\fR..PPReturns an empty rectangle if there is no intersection..PPSee 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..PPThe bounding rectangle of a nonempty rectangle and an empty or invalid rectangle is defined to be the nonempty rectangle..PPSee 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..PPSee also rLeft(), rTop(), and rRight()..SH "QCOORD & QRect::rLeft ()"Returns a reference to the left coordinate of the rectangle..PPSee also rTop(), rRight(), and rBottom()..SH "QCOORD & QRect::rRight ()"Returns a reference to the right coordinate of the rectangle..PPSee also rLeft(), rTop(), and rBottom()..SH "QCOORD & QRect::rTop ()"Returns a reference to the top coordinate of the rectangle..PPSee 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..PPSee also setRect() and coords()..PPExamples:.)l themes/metal.cpp and themes/wood.cpp..SH "int QRect::right () const"Returns the right coordinate of the rectangle..PPSee also setRight(), left(), topRight(), and bottomRight()..PPExamples:.)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..PPSee also bottom(), setTop(), and setHeight()..PPExample: 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..PPSee 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..PPSee 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..PPSee 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..PPSee also height(), setTop(), setBottom(), and setSize()..PPExample: 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..PPIdentical to setX()..PPSee also left(), setTop(), and setWidth()..PPExample: 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..PPSee also rect() and setCoords()..PPExample: 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..PPSee also right(), setLeft(), and setWidth()..PPExample: scribble/scribble.cpp..SH "void QRect::setSize ( const QSize & s )"Sets the size of the rectangle to \fIs\fR. The top-left corner is not moved..PPSee also size(), setWidth(), and setHeight()..PPExample: 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..PPIdentical to setY()..PPSee also top(), setBottom(), and setHeight()..PPExample: 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..PPSee 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..PPSee 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..PPSee also width(), setLeft(), setRight(), and setSize()..PPExample: 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..PPIdentical to setLeft()..PPSee 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..PPIdentical to setTop()..PPSee also y() and setX()..SH "QSize QRect::size () const"Returns the size of the rectangle..PPSee also width() and height()..PPExamples:.)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()..PPSee also setTop(), bottom(), topLeft(), and topRight()..PPExamples:.)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..PPSee also setTopLeft(), moveTopLeft(), bottomRight(), left(), and top()..PPExamples:.)l helpsystem/tooltip.cpp, t10/cannon.cpp, and tictac/tictac.cpp..SH "QPoint QRect::topRight () const"Returns the top-right position of the rectangle..PPSee also setTopRight(), moveTopRight(), bottomLeft(), top(), and right()..PPExample: 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..PPExamples:.)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..PPSee also height(), size(), and setHeight()..PPExamples:.)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()..PPSee also left(), y(), and setX()..PPExamples:.)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()..PPSee also top(), x(), and setY()..PPExamples:.)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 "QDataStream & operator<< ( QDataStream & s, const QRect & r )"Writes the QRect, \fIr\fR, to the stream \fIs\fR, and returns a reference to the stream..PPSee also Format of the QDataStream operators..SH "bool operator== ( const QRect & r1, const QRect & r2 )"Returns TRUE if \fIr1\fR and \fIr2\fR are equal; otherwise returns FALSE..SH "QDataStream & operator>> ( QDataStream & s, QRect & r )"Reads a QRect from the stream \fIs\fR into rect \fIr\fR and returns a reference to the stream..PPSee also Format of the QDataStream operators..SH "SEE ALSO".BR http://doc.trolltech.com/qrect.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf 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..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qrect.3qt) and the Qtversion (3.3.4).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -