⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qrect.3qt

📁 linux下GUI编程工具qt的在线连接帮助手册
💻 3QT
📖 第 1 页 / 共 2 页
字号:
'\" t.TH QRect 3qt "11 October 2001" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQRect \- Defines a rectangle in the plane.PP\fC#include <qrect.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 QSize & 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 "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 \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 "QSize \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 QSize & 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, bool proper = FALSE ) 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 "QDataStream & \fBoperator<<\fR ( QDataStream & s, const QRect & r )".br.ti -1c.BI "QDataStream & \fBoperator>>\fR ( QDataStream & s, QRect & r )".br.in -1c.SH DESCRIPTIONThe QRect class defines a rectangle in the plane..PPA 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..PPThe coordinate type is QCOORD (defined in qwindowdefs.h as \fCint\fR). The minimum value of QCOORD is QCOORD_MIN (-2147483648) and the maximum value is QCOORD_MAX (2147483647)..PPNote 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..PPGenerally, \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..PPThe 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..PPA QRect can be constructed with a set of left, top, width and height integers, from two QPoints or from a QPoint and a QSize. 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()..PPYou 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()..PPSee also QPoint, QSize, 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 QSize & 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..PPExample (creates three identical rectangles):.PP.nf.br    QRect r1( QPoint(100,200), QPoint(110,215) );.br    QRect r2( QPoint(100,200), QSize(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..SH "int QRect::bottom () const"Returns the bottom coordinate of the rectangle..PPSee also top(), setBottom(), bottomLeft() and bottomRight()..PPExamples:.)l 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..PPSee also moveBottomLeft(), bottomRight(), topLeft(), topRight(), bottom() and left()..PPExample: tictac/tictac.cpp..SH "QPoint QRect::bottomRight () const"Returns the bottom-right position of the rectangle..PPSee also moveBottomRight(), bottomLeft(), topLeft(), topRight(), bottom() and right()..PPExample: tictac/tictac.cpp..SH "QPoint QRect::center () const"Returns the center point of the rectangle..PPSee also moveCenter(), topLeft(), topRight(), bottomLeft() and bottomRight()..PPExample: 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..PPIf \fIproper\fR is TRUE, this function returns TRUE only if \fIp\fR is inside (not on the edge)..PPExample: t14/cannon.cpp..SH "bool QRect::contains ( int x, int y, bool proper = FALSE ) const"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPReturns TRUE if the point \fIx\fR, \fIy\fR is inside this rectangle; otherwise returns FALSE..PPIf \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..PPReturns TRUE if the rectangle \fIr\fR is inside this rectangle; otherwise returns FALSE..PPIf \fIproper\fR is TRUE, this function returns TRUE only if \fIr\fR is entirely inside (not on the edge)..PPSee 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..PPSee also setCoords() and rect()..PPExamples:.)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..PPSee also width(), size() and setHeight().

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -