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

void QPainterPath::addPath ( const QPainterPath path  ) 

Adds the given path to this path as a closed subpath.

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

Definition at line 1142 of file qpainterpath.cpp.

References d_func(), and isEmpty().

{
    if (other.isEmpty())
        return;

    ensureData();
    detach();

    QPainterPathData *d = reinterpret_cast<QPainterPathData *>(d_func());
    // Remove last moveto so we don't get multiple moveto's
    if (d->elements.last().type == MoveToElement)
        d->elements.remove(d->elements.size()-1);

    // Locate where our own current subpath will start after the other path is added.
    int cStart = d->elements.size() + other.d_func()->cStart;
    d->elements += other.d_func()->elements;
    d->cStart = cStart;

    d->require_moveTo = other.d_func()->isClosed();
}


Generated by  Doxygen 1.6.0   Back to index