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

void QPainterPath::addRegion ( const QRegion region  ) 

Adds the given region to the path by adding each rectangle in the region as a separate closed subpath.

See also:
addRect(), {QPainterPath::Composing a QPainterPath}{Composing a QPainterPath}

Definition at line 1203 of file qpainterpath.cpp.

References addRect(), QVector< T >::at(), QRegion::rects(), and QVector< T >::size().

Referenced by QPainter::clipPath(), QTransform::map(), QMatrix::map(), and QRasterPaintEngine::updateClipRegion().

{
    ensureData();
    detach();

    QVector<QRect> rects = region.rects();
    d_func()->elements.reserve(rects.size() * 5);
    for (int i=0; i<rects.size(); ++i)
        addRect(rects.at(i));
}


Generated by  Doxygen 1.6.0   Back to index