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

void QPainter::fillRect ( const QRectF rectangle,
const QBrush brush 
) [inherited]

Fills the given rectangle with the given brush.

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:
drawRect()

Definition at line 5768 of file qpainter.cpp.

References QPainter::brush(), QPainter::drawRect(), QPainter::isActive(), QPainter::pen(), QPainter::setBrush(), QPainter::setPen(), and QPen::style().

Referenced by MainWindow::createColorIcon(), MainWindow::createColorToolButtonIcon(), MyClass::createImage(), QTextLine::draw(), Q3IconView::drawBackground(), QGraphicsView::drawBackground(), Q3Canvas::drawBackground(), QGraphicsScene::drawBackground(), QItemDelegate::drawBackground(), QCommonStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QMotifStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), Q3TextEdit::drawContents(), QCDEStyle::drawControl(), QWindowsVistaStyle::drawControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QMotifStyle::drawControl(), QWindowsStyle::drawControl(), QWindowsXPStyle::drawControl(), QCommonStyle::drawControl(), QTextLayout::drawCursor(), QItemDelegate::drawDisplay(), QGraphicsScene::drawForeground(), QGraphicsView::drawForeground(), GLWidget::drawInstructions(), QStyle::drawItemText(), QPainter::drawPixmap(), QWindowsVistaStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QCDEStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), TetrixBoard::drawSquare(), QPainter::drawTextItem(), QPainter::drawTiledPixmap(), Q3Canvas::drawViewArea(), QPainter::eraseRect(), QPainter::fillRect(), QCommonStyle::generatedIconPixmap(), ImageComposer::loadImage(), Helper::paint(), Q3TableItem::paint(), Q3CheckTableItem::paint(), StarDelegate::paint(), PixelDelegate::paint(), Q3ListBox::paintCell(), Q3CheckListItem::paintCell(), Q3Table::paintCell(), Q3ListViewItem::paintCell(), Q3GridView::paintEmptyArea(), Q3Table::paintEmptyArea(), QWorkspace::paintEvent(), QHeaderView::paintEvent(), Window::paintEvent(), SplitterHandle::paintEvent(), QToolBar::paintEvent(), MandelbrotWidget::paintEvent(), CharacterWidget::paintEvent(), MyClass::paintEvent(), Q3ComboBox::paintEvent(), QPlainTextEdit::paintEvent(), QMdiArea::paintEvent(), QGraphicsView::paintEvent(), Q3IconViewItem::paintItem(), QGraphicsWidget::paintWindowFrame(), NorwegianWoodStyle::polish(), QPainter::qDrawShadePanel(), ImageComposer::recalculateResult(), QItemDelegate::selected(), TetrixBoard::showNextPiece(), TabletCanvas::TabletCanvas(), Q3ComboBox::updateMask(), and Q3ListBox::viewportPaintEvent().

{
    if (!isActive())
        return;
    QPen oldPen   = pen();
    bool swap = oldPen.style() != Qt::NoPen;
    if (swap)
        setPen(Qt::NoPen);
    QBrush oldBrush = this->brush();
    setBrush(brush);
    drawRect(r);
    setBrush(oldBrush);
    if (swap)
        setPen(oldPen);
}


Generated by  Doxygen 1.6.0   Back to index