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

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

Referenced by QFontEngine::alphaMapForGlyph(), MainWindow::createColorIcon(), Q3CanvasPolygonalItem::draw(), QTextLayout::draw(), Q3CanvasText::draw(), QTextLine::draw(), GraphWidget::drawBackground(), QStyleSheetStyle::drawComplexControl(), QCommonStyle::drawComplexControl(), QWindowsStyle::drawComplexControl(), QWindowsCEStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QPlastiqueStyle::drawComplexControl(), ArthurStyle::drawComplexControl(), QGtkStyle::drawComplexControl(), QMotifStyle::drawComplexControl(), QWindowsXPStyle::drawComplexControl(), QWindowsMobileStyle::drawComplexControl(), Q3TextEdit::drawContents(), QSplashScreen::drawContents(), KALedMeter::drawContents(), QPlastiqueStyle::drawControl(), QWindowsVistaStyle::drawControl(), QGtkStyle::drawControl(), QCleanlooksStyle::drawControl(), QWindowsCEStyle::drawControl(), QMotifStyle::drawControl(), QWindowsMobileStyle::drawControl(), QWindowsStyle::drawControl(), QWindowsXPStyle::drawControl(), QCommonStyle::drawControl(), QStyleSheetStyle::drawControl(), RenderArea::drawCoordinates(), QItemDelegate::drawDisplay(), Q3Canvas::drawForeground(), QPainter::drawImage(), GLWidget::drawInstructions(), QWindowsCEStyle::drawItemText(), QCleanlooksStyle::drawItemText(), QStyle::drawItemText(), ScribbleArea::drawLineTo(), RenderArea::drawOutline(), QOpenGLPaintEngine::drawPixmap(), QPainter::drawPixmap(), QPainter::drawPoints(), QPaintEngine::drawPoints(), QWindowsVistaStyle::drawPrimitive(), QWindowsMobileStyle::drawPrimitive(), QCommonStyle::drawPrimitive(), CustomStyle::drawPrimitive(), QWindowsXPStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QGtkStyle::drawPrimitive(), QMotifStyle::drawPrimitive(), QCDEStyle::drawPrimitive(), QWindowsCEStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), NorwegianWoodStyle::drawPrimitive(), ArthurStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QtPropertyEditorView::drawRow(), Q3CanvasEllipse::drawShape(), Q3CanvasPolygon::drawShape(), TetrixBoard::drawSquare(), QPainter::drawTiledPixmap(), Q3GroupBox::event(), Q3IconView::eventFilter(), QPicture::exec(), QPainter::fillPath(), QPainter::fillRect(), DiagramItem::image(), CodeEditor::lineNumberAreaPaintEvent(), BasicToolsPlugin::mouseMove(), QGraphicsSimpleTextItem::paint(), QGraphicsPathItem::paint(), StarRating::paint(), Helper::paint(), Q3TableItem::paint(), Q3CheckTableItem::paint(), Chip::paint(), DisplayWidget::paint(), QFontFamilyDelegate::paint(), ItemBase::paint(), SplashItem::paint(), QGraphicsLineItem::paint(), Node::paint(), QtPropertyEditorDelegate::paint(), QGraphicsEllipseItem::paint(), CircleItem::paint(), DemoTextItem::paint(), Edge::paint(), QGraphicsPolygonItem::paint(), Arrow::paint(), ColorItem::paint(), RobotHead::paint(), QT_BEGIN_NAMESPACE::PageItem::paint(), QGraphicsRectItem::paint(), PixelDelegate::paint(), Q3ListBox::paintCell(), Q3CheckListItem::paintCell(), Q3Table::paintCell(), Q3DataTable::paintCell(), Q3ListViewItem::paintCell(), QWellArray::paintCellContents(), QComboBox::paintEvent(), QLineEdit::paintEvent(), ShapedClock::paintEvent(), ColorDock::paintEvent(), RenderArea::paintEvent(), WorldTimeClock::paintEvent(), Q3TableHeader::paintEvent(), QWizardAntiFlickerWidget::paintEvent(), ClearButton::paintEvent(), Spacer::paintEvent(), QColorPicker::paintEvent(), LinearView::paintEvent(), ArthurFrame::paintEvent(), SimpleTransformation::paintEvent(), CombinedTransformation::paintEvent(), CircleWidget::paintEvent(), QLayoutWidget::paintEvent(), QWhatsThat::paintEvent(), QWizardHeader::paintEvent(), QPagePreview::paintEvent(), UrlLineEdit::paintEvent(), Window::paintEvent(), QStatusBar::paintEvent(), ChaseWidget::paintEvent(), QTableView::paintEvent(), AnalogClock::paintEvent(), QtColorButton::paintEvent(), PuzzleWidget::paintEvent(), qdesigner_internal::TabOrderEditor::paintEvent(), QtGradientWidget::paintEvent(), TicTacToe::paintEvent(), MandelbrotWidget::paintEvent(), SearchButton::paintEvent(), BasicOperations::paintEvent(), QColorLuminancePicker::paintEvent(), ShadeWidget::paintEvent(), Document::paintEvent(), CharacterWidget::paintEvent(), Workspace::paintEvent(), QPixelTool::paintEvent(), WigglyWidget::paintEvent(), qdesigner_internal::WidgetHandle::paintEvent(), Q3ComboBox::paintEvent(), MainWindow::paintEvent(), QtGradientStopsWidget::paintEvent(), Q3Header::paintEvent(), Q3Table::paintFocus(), TabletCanvas::paintImage(), Q3IconViewItem::paintItem(), Q3Header::paintSection(), CustomProxy::paintWindowFrame(), NorwegianWoodStyle::polish(), QPainter::qDrawPlainRect(), QPainter::qDrawShadeLine(), QPainter::qDrawShadePanel(), QPainter::qDrawShadeRect(), QPainter::strokePath(), Bubble::updateCache(), QT_BEGIN_NAMESPACE::PreviewMdiArea::viewportEvent(), 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;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index