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

QRectF QRectF::normalized (  )  const

Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height.

If width() < 0 the function swaps the left and right corners, and it swaps the top and bottom corners if height() < 0.

See also:
isValid(), isEmpty()

Definition at line 1405 of file qrect.cpp.

References h, w, xp, and yp.

Referenced by QPainterPath::addRoundedRect(), QPainterPath::addRoundRect(), Arrow::boundingRect(), contains(), QPainter::drawArc(), QPainter::drawChord(), QPainter::drawEllipse(), QRasterPaintEngine::drawImage(), QPainter::drawPie(), QRasterPaintEngine::drawRects(), QRasterPaintEngine::drawTiledPixmap(), intersects(), QPainterPath::intersects(), operator &(), operator|(), QtRectFPropertyManager::setConstraint(), and QtRectFPropertyManager::setValue().

{
    QRectF r = *this;
    if (r.w < 0) {
        r.xp = r.xp + r.w;
        r.w = -r.w;
    }
    if (r.h < 0) {
        r.yp = r.yp + r.h;
        r.h = -r.h;
    }
    return r;
}


Generated by  Doxygen 1.6.0   Back to index