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

void QPainter::setPen ( const QColor color  )  [inherited]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Sets the painter's pen to have style Qt::SolidLine, width 0 and the specified color.

Definition at line 2918 of file qpainter.cpp.

References QColor::isValid(), and QColor::rgb().

Referenced by Q3CanvasPolygonalItem::draw(), Q3CanvasText::draw(), QTextLayout::draw(), QTextLine::draw(), QCommonStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QMotifStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), Q3TextEdit::drawContents(), QSplashScreen::drawContents(), QPlastiqueStyle::drawControl(), QWindowsVistaStyle::drawControl(), QCleanlooksStyle::drawControl(), QMotifStyle::drawControl(), QWindowsStyle::drawControl(), QWindowsXPStyle::drawControl(), QCommonStyle::drawControl(), QItemDelegate::drawDisplay(), Q3Canvas::drawForeground(), Q3GroupBox::drawFrame(), QFrame::drawFrame(), QPainter::drawImage(), QCleanlooksStyle::drawItemText(), QStyle::drawItemText(), QPainter::drawPixmap(), QPainter::drawPoints(), QWindowsVistaStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QCDEStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), Q3CanvasEllipse::drawShape(), Q3CanvasPolygon::drawShape(), QPaintEngine::drawTextItem(), QPainter::drawTiledPixmap(), Q3GroupBox::event(), Q3IconView::eventFilter(), QPicture::exec(), QPainter::fillRect(), QGraphicsSimpleTextItem::paint(), QGraphicsPathItem::paint(), Q3CheckTableItem::paint(), Q3TableItem::paint(), QGraphicsLineItem::paint(), QGraphicsEllipseItem::paint(), QGraphicsPolygonItem::paint(), QGraphicsRectItem::paint(), Q3ListBox::paintCell(), Q3CheckListItem::paintCell(), Q3Table::paintCell(), Q3DataTable::paintCell(), Q3ListViewItem::paintCell(), QComboBox::paintEvent(), QLineEdit::paintEvent(), QStatusBar::paintEvent(), QTableView::paintEvent(), Q3ComboBox::paintEvent(), Q3Header::paintEvent(), Q3Table::paintFocus(), Q3IconViewItem::paintItem(), Q3Header::paintSection(), QPainter::qDrawPlainRect(), QPainter::qDrawShadeLine(), QPainter::qDrawShadePanel(), QPainter::qDrawShadeRect(), and Q3ListBox::viewportPaintEvent().

{
#ifdef QT_DEBUG_DRAW
    if (qt_show_painter_debug_output)
        printf("QPainter::setPen(), color=%04x\n", color.rgb());
#endif
    Q_D(QPainter);

    if (d->state->pen.style() == Qt::SolidLine
        && d->state->pen.widthF() == 0
        && d->state->pen.isSolid()
        && d->state->pen.color() == color)
        return;
    d->state->pen = QPen(color.isValid() ? color : QColor(Qt::black), 0, Qt::SolidLine);
    d->state->dirtyFlags |= QPaintEngine::DirtyPen;
}


Generated by  Doxygen 1.6.0   Back to index