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

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

Referenced by MainWindow::createColorIcon(), Q3CanvasPolygonalItem::draw(), QTextLayout::draw(), Q3CanvasText::draw(), QTextLine::draw(), QCommonStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QMotifStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), Q3TextEdit::drawContents(), QSplashScreen::drawContents(), QPlastiqueStyle::drawControl(), QWindowsVistaStyle::drawControl(), QGtkStyle::drawControl(), QCleanlooksStyle::drawControl(), QMotifStyle::drawControl(), QWindowsStyle::drawControl(), QWindowsXPStyle::drawControl(), QCommonStyle::drawControl(), RenderArea::drawCoordinates(), QItemDelegate::drawDisplay(), Q3Canvas::drawForeground(), Q3GroupBox::drawFrame(), QPainter::drawImage(), GLWidget::drawInstructions(), QCleanlooksStyle::drawItemText(), QStyle::drawItemText(), ScribbleArea::drawLineTo(), RenderArea::drawOutline(), QPainter::drawPixmap(), QPainter::drawPoints(), QPaintEngine::drawPoints(), QWindowsVistaStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), CustomStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QGtkStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QCDEStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), NorwegianWoodStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), Q3CanvasEllipse::drawShape(), Q3CanvasPolygon::drawShape(), TetrixBoard::drawSquare(), QPainter::drawTiledPixmap(), Q3GroupBox::event(), Q3IconView::eventFilter(), QPicture::exec(), QPainter::fillPath(), QPainter::fillRect(), DiagramItem::image(), CodeEditor::lineNumberAreaPaintEvent(), BasicToolsPlugin::mouseMove(), StarRating::paint(), Helper::paint(), QGraphicsPathItem::paint(), QGraphicsSimpleTextItem::paint(), Q3TableItem::paint(), Q3CheckTableItem::paint(), Node::paint(), QGraphicsLineItem::paint(), QGraphicsEllipseItem::paint(), Arrow::paint(), QGraphicsPolygonItem::paint(), PixelDelegate::paint(), QGraphicsRectItem::paint(), 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(), TicTacToe::paintEvent(), MandelbrotWidget::paintEvent(), BasicOperations::paintEvent(), Document::paintEvent(), CharacterWidget::paintEvent(), WigglyWidget::paintEvent(), Q3ComboBox::paintEvent(), Q3Header::paintEvent(), Q3Table::paintFocus(), TabletCanvas::paintImage(), Q3IconViewItem::paintItem(), Q3Header::paintSection(), NorwegianWoodStyle::polish(), QPainter::qDrawPlainRect(), QPainter::qDrawShadeLine(), QPainter::qDrawShadePanel(), QPainter::qDrawShadeRect(), QPainter::strokePath(), 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->engine) {
        qWarning("QPainter::setPen: Painter not active");
        return;
    }

    if (d->state->pen.style() == Qt::SolidLine
        && d->state->pen.widthF() == 0
        && d->state->pen.isSolid()
        && d->state->pen.color() == color)
        return;

    QPen pen(color.isValid() ? color : QColor(Qt::black), 0, Qt::SolidLine);

    d->state->pen = pen;
    if (d->extended)
        d->extended->penChanged();
    else
        d->state->dirtyFlags |= QPaintEngine::DirtyPen;
}


Generated by  Doxygen 1.6.0   Back to index