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,PathMovePathPolyline

属性文档

path : list<point>

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

它可以是用Qt.point() 构建的 JS 点数组,也可以是QPointFQListQVector ,或QPolygonF 。如果要将其绑定到某个 C++ 对象中的自定义属性,QPolygonF 是最合适的类型。


start : point [read-only]

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


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