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

void QPainterPath::moveTo ( const QPointF point  ) 

Moves the current point to the given point, implicitly starting a new subpath and closing the previous one.

See also:
closeSubpath(), {QPainterPath::Composing a QPainterPath}{Composing a QPainterPath}

Definition at line 626 of file qpainterpath.cpp.

References QPointF::x(), and QPointF::y().

Referenced by addEllipse(), addPolygon(), addRect(), arcMoveTo(), DiagramItem::DiagramItem(), QPlastiqueStyle::drawComplexControl(), QPainter::drawLines(), QPainter::drawPie(), QPainter::drawPoints(), QRasterPaintEngine::drawPoints(), QRasterPaintEngine::drawPolygon(), QCommonStyle::drawPrimitive(), QPicture::exec(), BasicToolsPlugin::generateShape(), QTransform::map(), moveTo(), NorwegianWoodStyle::roundRectPath(), Window::setupShapes(), SortingBox::SortingBox(), and toReversed().

{
#ifdef QPP_DEBUG
    printf("QPainterPath::moveTo() (%.2f,%.2f)\n", p.x(), p.y());
#endif
#ifndef QT_NO_DEBUG
    if (qt_is_nan(p.x()) || qt_is_nan(p.y()))
        qWarning("QPainterPath::moveTo: Adding point where x or y is NaN, results are undefined");
#endif
    ensureData();
    detach();

    QPainterPathData *d = d_func();
    Q_ASSERT(!d->elements.isEmpty());

    d->require_moveTo = false;

    if (d->elements.last().type == MoveToElement) {
        d->elements.last().x = p.x();
        d->elements.last().y = p.y();
    } else {
        Element elm = { p.x(), p.y(), MoveToElement };
        d->elements.append(elm);
    }
    d->cStart = d->elements.size() - 1;
}


Generated by  Doxygen 1.6.0   Back to index