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

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 3817 of file qpainter.cpp.

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

Referenced by QFontEngine::alphaMapForGlyph(), Q3CanvasPolygonalItem::draw(), QTextLayout::draw(), QTextLine::draw(), GraphWidget::drawBackground(), QCommonStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QWindowsCEStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QMotifStyle::drawComplexControl(), QWindowsMobileStyle::drawComplexControl(), KALedMeter::drawContents(), QWindowsVistaStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsCEStyle::drawControl(), QMotifStyle::drawControl(), QWindowsStyle::drawControl(), QWindowsXPStyle::drawControl(), QCommonStyle::drawControl(), Q3Canvas::drawForeground(), QPainter::drawImage(), RenderArea::drawOutline(), QPainter::drawPixmap(), QPaintEngine::drawPoints(), QWindowsMobileStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), CustomStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QCDEStyle::drawPrimitive(), QWindowsCEStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), ArthurStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QPainter::drawTiledPixmap(), QPicture::exec(), QPainter::fillPath(), QPainter::fillRect(), BasicToolsPlugin::mouseMove(), PaintArea::mousePressEvent(), QGraphicsItemGroup::paint(), QGraphicsSimpleTextItem::paint(), QGraphicsPathItem::paint(), Helper::paint(), StarRating::paint(), DisplayWidget::paint(), Car::paint(), Chip::paint(), QFontFamilyDelegate::paint(), SplashItem::paint(), RobotLimb::paint(), LayoutItem::paint(), Node::paint(), Mouse::paint(), RobotTorso::paint(), QGraphicsEllipseItem::paint(), Edge::paint(), CircleItem::paint(), QGraphicsPolygonItem::paint(), RobotHead::paint(), ColorItem::paint(), Arrow::paint(), QT_BEGIN_NAMESPACE::PageItem::paint(), QGraphicsRectItem::paint(), PixelDelegate::paint(), ShapedClock::paintEvent(), WorldTimeClock::paintEvent(), PaintWidget::paintEvent(), RenderArea::paintEvent(), ColorDock::paintEvent(), ClearButton::paintEvent(), ArthurFrame::paintEvent(), QWhatsThat::paintEvent(), Window::paintEvent(), UrlLineEdit::paintEvent(), ChaseWidget::paintEvent(), AnalogClock::paintEvent(), QtGradientWidget::paintEvent(), PuzzleWidget::paintEvent(), qdesigner_internal::TabOrderEditor::paintEvent(), MandelbrotWidget::paintEvent(), SearchButton::paintEvent(), SortingBox::paintEvent(), Document::paintEvent(), QColorLuminancePicker::paintEvent(), QPixelTool::paintEvent(), QtGradientStopsWidget::paintEvent(), Q3Table::paintFocus(), TabletCanvas::paintImage(), CustomProxy::paintWindowFrame(), QPainter::qDrawPlainRect(), QPainter::qDrawShadeRect(), QPainter::strokePath(), and Bubble::updateCache().

{
#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;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index