PathCurve QML Type
定义 Catmull-Rom 曲线上的一个点。更多
Import Statement: | import QtQuick |
属性
详细说明
PathCurve 提供了一种简单的方法来指定一条直接通过一组点的曲线。通常情况下,多条 PathCurve 曲线会串联使用,下面的示例就是证明:
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(); } }
该示例产生的路径如下(起点和 PathCurve 点用红色标出):
另请参见 Path,PathLine,PathQuad,PathCubic,PathArc 和PathSvg 。
属性文档
© 2025 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.