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

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

Referenced by Q3CanvasPolygonalItem::draw(), QTextLine::draw(), QCommonStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QMotifStyle::drawComplexControl(), QCleanlooksStyle::drawControl(), QMotifStyle::drawControl(), QWindowsStyle::drawControl(), QWindowsXPStyle::drawControl(), QCommonStyle::drawControl(), Q3Canvas::drawForeground(), QPainter::drawPixmap(), QCommonStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QCDEStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QPaintEngine::drawTextItem(), QPainter::drawTiledPixmap(), QPicture::exec(), QPainter::fillRect(), QGraphicsPathItem::paint(), QGraphicsSimpleTextItem::paint(), QGraphicsItemGroup::paint(), QGraphicsTextItem::paint(), QGraphicsLineItem::paint(), QGraphicsPixmapItem::paint(), QGraphicsEllipseItem::paint(), QGraphicsPolygonItem::paint(), QGraphicsRectItem::paint(), Q3Table::paintFocus(), QPainter::qDrawPlainRect(), and QPainter::qDrawShadeRect().

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

    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