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

void QPainterPath::connectPath ( const QPainterPath path  ) 

Connects the given path to this path by adding a line from the last element of this path to the first element of the given path.

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

Definition at line 1173 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;
    int first = d->elements.size();
    d->elements += other.d_func()->elements;

    d->elements[first].type = LineToElement;
    if (cStart != first)
        d->cStart = cStart;
}


Generated by  Doxygen 1.6.0   Back to index