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

void QPainterPath::addRoundRect ( const QRectF rect,
int  roundness 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Adds a rounded rectangle, rect, to the path.

The roundness argument specifies uniform roundness for the rectangle. Vertical and horizontal roundness factors will be adjusted accordingly to act uniformly around both axes. Use this method if you want a rectangle equally rounded across both the X and Y axis.

See also:

Definition at line 333 of file qpainterpath.h.

References addRoundRect(), QRectF::height(), and QRectF::width().

    int xRnd = roundness;
    int yRnd = roundness;
    if (rect.width() > rect.height())
        xRnd = int(roundness * rect.height()/rect.width());
        yRnd = int(roundness * rect.width()/rect.height());
    addRoundRect(rect, xRnd, yRnd);

Generated by  Doxygen 1.6.0   Back to index