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

void QPainter::setBrush ( const QBrush brush  )  [inherited]

Sets the painter's brush to the given brush.

The painter's brush defines how shapes are filled.

See also:
brush(), {QPainter::Settings}{Settings}

Definition at line 3813 of file qpainter.cpp.

References QBrush::color(), QBrush::d, QColor::rgb(), and QBrush::style().

Referenced by Q3CanvasPolygonalItem::draw(), QTextLayout::draw(), QTextLine::draw(), QCommonStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QMotifStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), QCleanlooksStyle::drawControl(), QMotifStyle::drawControl(), QWindowsStyle::drawControl(), QWindowsXPStyle::drawControl(), QCommonStyle::drawControl(), Q3Canvas::drawForeground(), QPainter::drawImage(), RenderArea::drawOutline(), QPainter::drawPixmap(), QPaintEngine::drawPoints(), QCommonStyle::drawPrimitive(), CustomStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QCDEStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QPainter::drawTiledPixmap(), QPicture::exec(), QPainter::fillPath(), QPainter::fillRect(), BasicToolsPlugin::mouseMove(), Helper::paint(), StarRating::paint(), QGraphicsPathItem::paint(), QGraphicsSimpleTextItem::paint(), QGraphicsItemGroup::paint(), LayoutItem::paint(), Node::paint(), Mouse::paint(), QGraphicsEllipseItem::paint(), Arrow::paint(), QGraphicsPolygonItem::paint(), PixelDelegate::paint(), QGraphicsRectItem::paint(), ShapedClock::paintEvent(), WorldTimeClock::paintEvent(), RenderArea::paintEvent(), Window::paintEvent(), AnalogClock::paintEvent(), MandelbrotWidget::paintEvent(), SortingBox::paintEvent(), Document::paintEvent(), Q3Table::paintFocus(), TabletCanvas::paintImage(), QPainter::qDrawPlainRect(), QPainter::qDrawShadeRect(), and QPainter::strokePath().

{
#ifdef QT_DEBUG_DRAW
    if (qt_show_painter_debug_output)
        printf("QPainter::setBrush(), color=%04x, style=%d\n", brush.color().rgb(), brush.style());
#endif
    Q_D(QPainter);
    if (!d->engine) {
        qWarning("QPainter::setBrush: Painter not active");
        return;
    }

    if (d->state->brush.d == brush.d)
        return;

    if (d->extended) {
        d->state->brush = brush;
        d->checkEmulation();
        d->extended->brushChanged();
        return;
    }

    Qt::BrushStyle currentStyle = d->state->brush.style();
    if (currentStyle == brush.style()) {
        if (currentStyle == Qt::NoBrush
            || (currentStyle == Qt::SolidPattern
                && d->state->brush.color() == brush.color()))
            return;
    }

    d->state->brush = brush;
    d->state->dirtyFlags |= QPaintEngine::DirtyBrush;
}


Generated by  Doxygen 1.6.0   Back to index