本页内容

PathPolyline QML Type

通过一组坐标定义一条多段线。更多...

Import Statement: import QtQuick
Since: QtQuick 2.14

属性

详细说明

下面的示例在容器图形的边界框边缘创建了一条由四个顶点组成的三角形路径。通过容器图形的scale 属性,该路径将随其容器图形一起进行缩放。

PathPolyline {
    id: ppl
    path: [ Qt.point(0.0, 0.0),
            Qt.point(1.0, 0.0),
            Qt.point(0.5, 1.0),
            Qt.point(0.0, 0.0)
          ]
}

另请参阅 Path 、PathQuad 、PathCubic 、PathArc 、PathAngleArc 、PathCurve 、PathSvg 以及PathMove 。

属性文档

path : list<point>

该属性定义了折线的顶点。

它可以是使用Qt.point() 构建的点数组(JS数组)、QList ,或是QPointF 的QVector ,亦或是QPolygonF 。若您要将其绑定到某个C++对象中的自定义属性,QPolygonF 是最佳的选择。

start : point [read-only]

此只读属性包含多线的起始点。

© 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.