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

void QPainter::drawEllipse ( const QRectF rectangle  )  [inherited]

Draws the ellipse defined by the given rectangle.

A filled ellipse has a size of {rectangle}. {QRect::size()}{size()}. A stroked ellipse has a size of {rectangle}. {QRect::size()}{size()} plus the pen width.

100% qpainter-ellipse.png doc/src/snippets/code/src_gui_painting_qpainter.cpp 9

See also:
drawPie(), {The Coordinate System}

Definition at line 4161 of file qpainter.cpp.

References QPainterPath::addEllipse(), QRectF::height(), QRectF::isEmpty(), QRectF::normalized(), QRectF::translate(), QRectF::width(), QRectF::x(), and QRectF::y().

Referenced by QCommonStyle::drawComplexControl(), QCleanlooksStyle::drawControl(), Q3Painter::drawEllipse(), QPainter::drawEllipse(), QPaintEngine::drawPoints(), QCommonStyle::drawPrimitive(), QCleanlooksStyle::drawPrimitive(), QPlastiqueStyle::drawPrimitive(), Q3CanvasEllipse::drawShape(), QPicture::exec(), BasicToolsPlugin::mouseMove(), Helper::paint(), Node::paint(), Mouse::paint(), QGraphicsEllipseItem::paint(), PixelDelegate::paint(), CircleWidget::paintEvent(), Window::paintEvent(), TicTacToe::paintEvent(), Document::paintEvent(), and TabletCanvas::paintImage().

{
#ifdef QT_DEBUG_DRAW
    if (qt_show_painter_debug_output)
        printf("QPainter::drawEllipse(), [%.2f,%.2f,%.2f,%.2f]\n", r.x(), r.y(), r.width(), r.height());
#endif
    Q_D(QPainter);

    if (!d->engine)
        return;

    QRectF rect(r.normalized());
    if (rect.isEmpty())
        return;

    if (d->extended) {
        d->extended->drawEllipse(rect);
        return;
    }

    d->updateState(d->state);
    if (d->state->emulationSpecifier) {
        if (d->state->emulationSpecifier == QPaintEngine::PrimitiveTransform
            && d->state->matrix.type() == QTransform::TxTranslate) {
            rect.translate(QPointF(d->state->matrix.dx(), d->state->matrix.dy()));
        } else {
            QPainterPath path;
            path.addEllipse(rect);
            d->draw_helper(path, QPainterPrivate::StrokeAndFillDraw);
            return;
        }
    }

    d->engine->drawEllipse(rect);
}


Generated by  Doxygen 1.6.0   Back to index