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

void QPainter::fillPath ( const QPainterPath path,
const QBrush brush 
) [inherited]

Fills the given path using the given brush. The outline is not drawn.

Alternatively, you can specify a QColor instead of a QBrush; the QBrush constructor (taking a QColor argument) will automatically create a solid pattern brush.

See also:
drawPath()

Definition at line 2779 of file qpainter.cpp.

References QPainter::drawPath(), and QPainter::isActive().

Referenced by QCDEStyle::drawControl(), NorwegianWoodStyle::drawPrimitive(), RenderArea::drawShape(), and QGraphicsWidget::paintWindowFrame().

{
    if (!isActive())
        return;

    Q_D(QPainter);
    QBrush oldBrush = d->state->brush;
    QPen oldPen = d->state->pen;

    d->state->pen = Qt::NoPen;
    d->state->brush = brush;
    d->engine->setDirty(QPaintEngine::DirtyFlags(QPaintEngine::DirtyPen | QPaintEngine::DirtyBrush));

    drawPath(path);

    // Reset old state
    d->state->pen = oldPen;
    d->state->brush = oldBrush;
    d->engine->setDirty(QPaintEngine::DirtyFlags(QPaintEngine::DirtyPen | QPaintEngine::DirtyBrush));
}


Generated by  Doxygen 1.6.0   Back to index