868bool QRect::contains(
const QRect &r,
bool proper)
const noexcept
870 if (isNull() || r.isNull())
873 Representation l1 = x1;
874 Representation r1 = x1 - 1;
880 Representation l2 = r.x1;
881 Representation r2 = r.x1 - 1;
888 if (l2 <= l1 || r2 >= r1)
891 if (l2 < l1 || r2 > r1)
895 Representation t1 = y1;
896 Representation b1 = y1 - 1;
902 Representation t2 = r.y1;
903 Representation b2 = r.y1 - 1;
910 if (t2 <= t1 || b2 >= b1)
913 if (t2 < t1 || b2 > b1)
946QRect QRect::operator|(
const QRect &r)
const noexcept
953 Representation l1 = x1;
954 Representation r1 = x1 - 1;
960 Representation l2 = r.x1;
961 Representation r2 = r.x1 - 1;
967 Representation t1 = y1;
968 Representation b1 = y1 - 1;
974 Representation t2 = r.y1;
975 Representation b2 = r.y1 - 1;
982 tmp.x1 = qMin(l1, l2);
983 tmp.x2 = qMax(r1, r2);
984 tmp.y1 = qMin(t1, t2);
985 tmp.y2 = qMax(b1, b2);
1248QDataStream &operator<<(QDataStream &s,
const QRect &r)
1250 if (s.version() == 1)
1251 s << (qint16)r.left() << (qint16)r.top()
1252 << (qint16)r.right() << (qint16)r.bottom();
1254 s << (qint32)r.left() << (qint32)r.top()
1255 << (qint32)r.right() << (qint32)r.bottom();
1271 if (s.version() == 1) {
1272 qint16 x1, y1, x2, y2;
1273 s >> x1; s >> y1; s >> x2; s >> y2;
1274 r.setCoords(x1, y1, x2, y2);
1277 qint32 x1, y1, x2, y2;
1278 s >> x1; s >> y1; s >> x2; s >> y2;
1279 r.setCoords(x1, y1, x2, y2);
2162QRectF QRectF::operator|(
const QRectF &r)
const noexcept
2177 left = qMin(left, r.xp + r.w);
2178 right = qMax(right, r.xp);
2180 left = qMin(left, r.xp);
2181 right = qMax(right, r.xp + r.w);
2192 top = qMin(top, r.yp + r.h);
2193 bottom = qMax(bottom, r.yp);
2195 top = qMin(top, r.yp);
2196 bottom = qMax(bottom, r.yp + r.h);
2199 return QRectF(left, top, right - left, bottom - top);