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

QPainterPath QPainterPathStroker::createStroke ( const QPainterPath path  )  const

Generates a new path that is a fillable area representing the outline of the given path.

The various design aspects of the outline are based on the stroker's properties: width(), capStyle(), joinStyle(), dashPattern(), curveThreshold() and miterLimit().

The generated path should only be used for outlining the given painter path. Otherwise it may cause unexpected behavior. Generated outlines also require the Qt::WindingFill rule which is set by default.

Definition at line 2431 of file qpainterpath.cpp.

References QPainterPath::isEmpty(), and QPainterPath::setFillRule().

{
    QPainterPathStrokerPrivate *d = const_cast<QPainterPathStrokerPrivate *>(d_func());
    QPainterPath stroke;
    if (path.isEmpty())
        return path;
    if (d->dashPattern.isEmpty()) {
        d->stroker.strokePath(path, &stroke, QTransform());
    } else {
        QDashStroker dashStroker(&d->stroker);
        dashStroker.setDashPattern(d->dashPattern);
        dashStroker.setDashOffset(d->dashOffset);
        dashStroker.strokePath(path, &stroke, QTransform());
    }
    stroke.setFillRule(Qt::WindingFill);
    return stroke;
}


Generated by  Doxygen 1.6.0   Back to index