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

void QPainter::drawPath ( const QPainterPath path  )  [inherited]

Draws the given painter path using the current pen for outline and the current brush for filling.

100% qpainter-path.png

    QPainterPath path;
    path.moveTo(20, 80);
    path.lineTo(20, 30);
    path.cubicTo(80, 0, 50, 50, 80, 80);

    QPainter painter(this);
    painter.drawPath(path);

See also:
{painting/painterpaths}{the Painter Paths example},{demos/deform}{the Vector Deformation demo}

Definition at line 2479 of file qpainter.cpp.

References QPainterPath::boundingRect(), QPainterPath::elementCount(), QRectF::height(), QPainter::isActive(), QRectF::width(), QRectF::x(), and QRectF::y().

Referenced by QTextLayout::draw(), QTextLine::draw(), QPainter::drawChord(), QPlastiqueStyle::drawComplexControl(), QCommonStyle::drawControl(), QPainter::drawPie(), QCommonStyle::drawPrimitive(), QPainter::drawRoundRect(), QPaintEngine::drawTextItem(), QPicture::exec(), QPainter::fillPath(), QGraphicsPathItem::paint(), and QPainter::strokePath().

{
#ifdef QT_DEBUG_DRAW
    QRectF pathBounds = path.boundingRect();
    if (qt_show_painter_debug_output)
        printf("QPainter::drawPath(), size=%d, [%.2f,%.2f,%.2f,%.2f]\n",
               path.elementCount(),
               pathBounds.x(), pathBounds.y(), pathBounds.width(), pathBounds.height());
#endif

    if (!isActive())
        return;

    Q_D(QPainter);
    d->updateState(d->state);

    if (d->engine->hasFeature(QPaintEngine::PainterPaths) && d->state->emulationSpecifier == 0) {
        d->engine->drawPath(path);
    } else {
        d->draw_helper(path);
    }
}


Generated by  Doxygen 1.6.0   Back to index