1112 if (p.
x() <= l || p.
x() >= r)
1115 if (p.
x() < l || p.
x() > r)
1127 if (p.
y() <= t || p.
y() >= b)
1130 if (p.
y() < t || p.
y() > b)
1181 if (
x2 -
x1 + 1 < 0)
1188 if (r.
x2 - r.
x1 + 1 < 0)
1194 if (l2 <= l1 || r2 >= r1)
1197 if (l2 < l1 || r2 > r1)
1203 if (
y2 -
y1 + 1 < 0)
1210 if (r.
y2 - r.
y1 + 1 < 0)
1216 if (t2 <= t1 || b2 >= b1)
1219 if (t2 < t1 || b2 > b1)
1270 if (
x2 -
x1 + 1 < 0)
1277 if (r.
x2 - r.
x1 + 1 < 0)
1284 if (
y2 -
y1 + 1 < 0)
1291 if (r.
y2 - r.
y1 + 1 < 0)
1348 if (
x2 -
x1 + 1 < 0)
1355 if (r.
x2 - r.
x1 + 1 < 0)
1360 if (l1 > r2 || l2 > r1)
1365 if (
y2 -
y1 + 1 < 0)
1372 if (r.
y2 - r.
y1 + 1 < 0)
1377 if (t1 > b2 || t2 > b1)
1436 if (
x2 -
x1 + 1 < 0)
1443 if (r.
x2 - r.
x1 + 1 < 0)
1448 if (l1 > r2 || l2 > r1)
1453 if (
y2 -
y1 + 1 < 0)
1460 if (r.
y2 - r.
y1 + 1 < 0)
1465 if (t1 > b2 || t2 > b1)
1498 #ifndef QT_NO_DATASTREAM 1540 s >>
x1; s >>
y1; s >>
x2; s >>
y2;
1545 s >>
x1; s >>
y1; s >>
x2; s >>
y2;
1551 #endif // QT_NO_DATASTREAM 1554 #ifndef QT_NO_DEBUG_STREAM 1556 dbg.
nospace() <<
"QRect(" << r.
x() <<
',' << r.
y() <<
' ' 2360 if (p.
x() < l || p.
x() > r)
2372 if (p.
y() < t || p.
y() > b)
2421 if (l2 < l1 || r2 > r1)
2442 if (t2 < t1 || b2 > b1)
2587 left =
qMin(left, r.
xp + r.
w);
2588 right =
qMax(right, r.
xp);
2591 right =
qMax(right, r.
xp + r.
w);
2603 bottom =
qMax(bottom, r.
yp);
2606 bottom =
qMax(bottom, r.
yp + r.
h);
2609 return QRectF(left, top, right - left, bottom - top);
2670 if (l1 >= r2 || l2 >= r1)
2691 if (t1 >= b2 || t2 >= b1)
2697 tmp.
w =
qMin(r1, r2) - tmp.
xp;
2698 tmp.
h =
qMin(b1, b2) - tmp.
yp;
2764 if (l1 >= r2 || l2 >= r1)
2785 if (t1 >= b2 || t2 >= b1)
2819 int xmin = int(
qFloor(xp));
2820 int xmax = int(
qCeil(xp + w));
2821 int ymin = int(
qFloor(yp));
2822 int ymax = int(
qCeil(yp + h));
2823 return QRect(xmin, ymin, xmax - xmin, ymax - ymin);
2864 #ifndef QT_NO_DATASTREAM 2881 s << double(r.
x()) <<
double(r.
y()) <<
double(r.
width()) <<
double(r.
height());
2910 #endif // QT_NO_DATASTREAM 2913 #ifndef QT_NO_DEBUG_STREAM 2915 dbg.
nospace() <<
"QRectF(" << r.
x() <<
',' << r.
y() <<
' ' The QDebug class provides an output stream for debugging information.
QRect toAlignedRect() const
Returns a QRect based on the values of this rectangle that is the smallest possible integer rectangle...
qreal y() const
Returns the y-coordinate of the rectangle's top edge.
bool isNull() const
Returns true if the rectangle is a null rectangle, otherwise returns false.
QRectF operator|(const QRectF &r) const
Returns the bounding rectangle of this rectangle and the given rectangle.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
QRect operator &(const QRect &r) const
QDebug & nospace()
Clears the stream's internal flag that records whether the last character was a space and returns a r...
The QPointF class defines a point in the plane using floating point precision.
QRect normalized() const
Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height...
int left() const
Returns the x-coordinate of the rectangle's left edge.
int width() const
Returns the width of the rectangle.
int height() const
Returns the height of the rectangle.
bool intersects(const QRectF &r) const
Returns true if this rectangle intersects with the given rectangle (i.
int bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
qreal x() const
Returns the x-coordinate of this point.
bool contains(const QPointF &p) const
Returns true if the given point is inside or on the edge of the rectangle; otherwise returns false...
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QRectF class defines a rectangle in the plane using floating point precision. ...
QRect()
Constructs a null rectangle.
qreal height() const
Returns the height of the rectangle.
qreal width() const
Returns the width of the rectangle.
void setRect(qreal x, qreal y, qreal w, qreal h)
Sets the coordinates of the rectangle's top-left corner to (x, y), and its size to the given width an...
void setCoords(int x1, int y1, int x2, int y2)
Sets the coordinates of the rectangle's top-left corner to (x1, y1), and the coordinates of its botto...
QRectF operator &(const QRectF &r) const
Returns the intersection of this rectangle and the given rectangle.
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
void moveCenter(const QPoint &p)
Moves the rectangle, leaving the center point at the given position.
QDataStream & operator>>(QDataStream &stream, QRect &rectangle)
Reads a rectangle from the given stream into the given rectangle, and returns a reference to the stre...
int version() const
Returns the version number of the data serialization format.
int top() const
Returns the y-coordinate of the rectangle's top edge.
int right() const
Returns the x-coordinate of the rectangle's right edge.
int y() const
Returns the y-coordinate of the rectangle's top edge.
qreal x() const
Returns the x-coordinate of the rectangle's left edge.
int x() const
Returns the x-coordinate of the rectangle's left edge.
The QPoint class defines a point in the plane using integer precision.
The QRect class defines a rectangle in the plane using integer precision.
int y() const
Returns the y coordinate of this point.
qreal y() const
Returns the y-coordinate of this point.
The QDataStream class provides serialization of binary data to a QIODevice.
bool intersects(const QRect &r) const
Returns true if this rectangle intersects with the given rectangle (i.
int x() const
Returns the x coordinate of this point.
QRect operator|(const QRect &r) const
Returns the bounding rectangle of this rectangle and the given rectangle.
QRectF normalized() const
Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height...
QDebug & space()
Writes a space character to the debug stream and returns a reference to the stream.
bool isNull() const
Returns true if the rectangle is a null rectangle, otherwise returns false.
QDataStream & operator<<(QDataStream &stream, const QRect &rectangle)
Writes the given rectangle to the given stream, and returns a reference to the stream.