Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QRectF QRectF::operator| ( const QRectF rectangle  )  const

Returns the bounding rectangle of this rectangle and the given rectangle.

See also:
united(), operator|=()

Definition at line 1919 of file qrect.cpp.

References h, isNull(), normalized(), w, xp, and yp.

    if (isNull())
        return r;
    if (r.isNull())
        return *this;
    QRectF r1 = normalized();
    QRectF r2 = r.normalized();
    QRectF tmp;
    tmp.xp = qMin(r1.xp, r2.xp);
    tmp.yp = qMin(r1.yp, r2.yp);
    tmp.w = qMax(r1.xp + r1.w, r2.xp + r2.w) - tmp.xp;
    tmp.h = qMax(r1.yp + r1.h, r2.yp + r2.h) - tmp.yp;
    return tmp;

Generated by  Doxygen 1.6.0   Back to index