En esta página

PathCurve QML Type

Define un punto en una curva de Catmull-Rom. Más...

Import Statement: import QtQuick

Propiedades

Descripción detallada

PathCurve ofrece una forma sencilla de especificar una curva que pase directamente por un conjunto de puntos. Normalmente se utilizan varias PathCurves en serie, tal y como muestra el siguiente ejemplo:

import QtQuick

Canvas {
    width: 400; height: 200
    contextType: "2d"

    Path {
        id: myPath
        startX: 0; startY: 100

        PathCurve { x: 75; y: 75 }
        PathCurve { x: 200; y: 150 }
        PathCurve { x: 325; y: 25 }
        PathCurve { x: 400; y: 100 }
    }

    onPaint: {
        context.strokeStyle = Qt.rgba(.4,.6,.8);
        context.path = myPath;
        context.stroke();
    }
}

Este ejemplo genera la siguiente trayectoria (con el punto inicial y los puntos de la PathCurve resaltados en rojo):

Curva de Catmull-Rom que pasa por cinco puntos resaltados en rojo y forma un patrón ondulado

Véase también Path, PathLine, PathQuad, PathCubic, PathArc y PathSvg.

Documentación de la propiedad

relativeX : real

relativeY : real

Define el punto final de la curva con respecto a su punto inicial.

Si se especifican tanto una posición final relativa como una absoluta para un mismo eje, se utilizará la posición relativa.

Se pueden combinar posiciones relativas y absolutas; por ejemplo, es válido establecer una x relativa y una y absoluta.

Véase también x y y.

x : real

y : real

Define el punto final de la curva.

Véase también relativeX y relativeY.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.