863bool QRect::contains(
const QRect &r,
bool proper)
const noexcept
865 if (isNull() || r.isNull())
868 Representation l1 = x1;
869 Representation r1 = x1 - 1;
875 Representation l2 = r.x1;
876 Representation r2 = r.x1 - 1;
883 if (l2 <= l1 || r2 >= r1)
886 if (l2 < l1 || r2 > r1)
890 Representation t1 = y1;
891 Representation b1 = y1 - 1;
897 Representation t2 = r.y1;
898 Representation b2 = r.y1 - 1;
905 if (t2 <= t1 || b2 >= b1)
908 if (t2 < t1 || b2 > b1)
941QRect QRect::operator|(
const QRect &r)
const noexcept
948 Representation l1 = x1;
949 Representation r1 = x1 - 1;
955 Representation l2 = r.x1;
956 Representation r2 = r.x1 - 1;
962 Representation t1 = y1;
963 Representation b1 = y1 - 1;
969 Representation t2 = r.y1;
970 Representation b2 = r.y1 - 1;
977 tmp.x1 = qMin(l1, l2);
978 tmp.x2 = qMax(r1, r2);
979 tmp.y1 = qMin(t1, t2);
980 tmp.y2 = qMax(b1, b2);
1243QDataStream &operator<<(QDataStream &s,
const QRect &r)
1245 if (s.version() == 1)
1246 s << (qint16)r.left() << (qint16)r.top()
1247 << (qint16)r.right() << (qint16)r.bottom();
1249 s << (qint32)r.left() << (qint32)r.top()
1250 << (qint32)r.right() << (qint32)r.bottom();
1266 if (s.version() == 1) {
1267 qint16 x1, y1, x2, y2;
1268 s >> x1; s >> y1; s >> x2; s >> y2;
1269 r.setCoords(x1, y1, x2, y2);
1272 qint32 x1, y1, x2, y2;
1273 s >> x1; s >> y1; s >> x2; s >> y2;
1274 r.setCoords(x1, y1, x2, y2);
2153QRectF QRectF::operator|(
const QRectF &r)
const noexcept
2168 left = qMin(left, r.xp + r.w);
2169 right = qMax(right, r.xp);
2171 left = qMin(left, r.xp);
2172 right = qMax(right, r.xp + r.w);
2183 top = qMin(top, r.yp + r.h);
2184 bottom = qMax(bottom, r.yp);
2186 top = qMin(top, r.yp);
2187 bottom = qMax(bottom, r.yp + r.h);
2190 return QRectF(left, top, right - left, bottom - top);