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

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

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

Referenced by MainWindow::createColorIcon(), Q3CanvasPolygonalItem::draw(), QTextLayout::draw(), Q3CanvasText::draw(), QTextLine::draw(), QCommonStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QMotifStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), Q3TextEdit::drawContents(), QSplashScreen::drawContents(), QWindowsVistaStyle::drawControl(), QPlastiqueStyle::drawControl(), QCleanlooksStyle::drawControl(), QMotifStyle::drawControl(), QWindowsStyle::drawControl(), QWindowsXPStyle::drawControl(), QCommonStyle::drawControl(), RenderArea::drawCoordinates(), QItemDelegate::drawDisplay(), Q3Canvas::drawForeground(), Q3GroupBox::drawFrame(), QFrame::drawFrame(), QPainter::drawImage(), GLWidget::drawInstructions(), QCleanlooksStyle::drawItemText(), QStyle::drawItemText(), ScribbleArea::drawLineTo(), RenderArea::drawOutline(), QPainter::drawPixmap(), QPainter::drawPoints(), QWindowsVistaStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), CustomStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QCDEStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), NorwegianWoodStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), Q3CanvasEllipse::drawShape(), Q3CanvasPolygon::drawShape(), TetrixBoard::drawSquare(), QPaintEngine::drawTextItem(), QPainter::drawTiledPixmap(), Q3GroupBox::event(), Q3IconView::eventFilter(), QPicture::exec(), QPainter::fillRect(), DiagramItem::image(), BasicToolsPlugin::mouseMove(), StarRating::paint(), Helper::paint(), Q3TableItem::paint(), Q3CheckTableItem::paint(), Arrow::paint(), PixelDelegate::paint(), CannonField::paintBarrier(), CannonField::paintCannon(), Q3ListBox::paintCell(), Q3CheckListItem::paintCell(), Q3Table::paintCell(), Q3DataTable::paintCell(), Q3ListViewItem::paintCell(), QComboBox::paintEvent(), QLineEdit::paintEvent(), ShapedClock::paintEvent(), RenderArea::paintEvent(), WorldTimeClock::paintEvent(), CombinedTransformation::paintEvent(), CircleWidget::paintEvent(), Window::paintEvent(), QStatusBar::paintEvent(), QTableView::paintEvent(), AnalogClock::paintEvent(), CannonField::paintEvent(), TicTacToe::paintEvent(), MandelbrotWidget::paintEvent(), BasicOperations::paintEvent(), Document::paintEvent(), CharacterWidget::paintEvent(), WigglyWidget::paintEvent(), Q3ComboBox::paintEvent(), Q3Header::paintEvent(), Q3Table::paintFocus(), TabletCanvas::paintImage(), Q3IconViewItem::paintItem(), Q3Header::paintSection(), CannonField::paintShot(), CannonField::paintTarget(), NorwegianWoodStyle::polish(), QPainter::qDrawPlainRect(), QPainter::qDrawShadeLine(), QPainter::qDrawShadePanel(), QPainter::qDrawShadeRect(), qt_graphicsItem_highlightSelected(), QGraphicsItem::qt_graphicsItem_highlightSelected(), 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