Path QML Type

Defines a path for use by PathView and Shape . 更多...

import 语句: import QtQuick 2.12
继承者: ShapePath

特性

详细描述

A Path is composed of one or more path segments - PathLine , PathQuad , PathCubic , PathArc , PathAngleArc , PathCurve , PathSvg .

The spacing of the items along the Path can be adjusted via a PathPercent 对象。

PathAttribute allows named attributes with values to be defined along the path.

Path and the other types for specifying path elements are shared between PathView and Shape . The following table provides an overview of the applicability of the various path elements:

元素 PathView 形状 Shape, GL_NV_path_rendering Shape, software
PathMove N/A Yes Yes Yes
PathLine Yes Yes Yes Yes
PathQuad Yes Yes Yes Yes
PathCubic Yes Yes Yes Yes
PathArc Yes Yes Yes Yes
PathAngleArc Yes Yes Yes Yes
PathSvg Yes Yes Yes Yes
PathAttribute Yes N/A N/A N/A
PathPercent Yes N/A N/A N/A
PathCurve Yes No No No

注意: Path is a non-visual type; it does not display anything on its own. To draw a path, use Shape .

另请参阅 PathView , Shape , PathAttribute , PathPercent , PathLine , PathMove , PathQuad , PathCubic , PathArc , PathAngleArc , PathCurve ,和 PathSvg .

特性文档编制

closed : bool

This property holds whether the start and end of the path are identical.

[default] pathElements : list < PathElement >

This property holds the objects composing the path.

A path can contain the following path objects:

  • PathLine - a straight line to a given position.
  • PathQuad - a quadratic Bezier curve to a given position with a control point.
  • PathCubic - a cubic Bezier curve to a given position with two control points.
  • PathArc - an arc to a given position with a radius.
  • PathAngleArc - an arc specified by center point, radii, and angles.
  • PathSvg - a path specified as an SVG path data string.
  • PathCurve - a point on a Catmull-Rom curve.
  • PathAttribute - an attribute at a given position in the path.
  • PathPercent - a way to spread out items along various segments of the path.
    PathView {
        anchors.fill: parent
        model: ContactModel {}
        delegate: delegate
        path: Path {
            startX: 120; startY: 100
            PathAttribute { name: "iconScale"; value: 1.0 }
            PathAttribute { name: "iconOpacity"; value: 1.0 }
            PathQuad { x: 120; y: 25; controlX: 260; controlY: 75 }
            PathAttribute { name: "iconScale"; value: 0.3 }
            PathAttribute { name: "iconOpacity"; value: 0.5 }
            PathQuad { x: 120; y: 100; controlX: -20; controlY: 75 }
        }
    }
							

startX : real

These properties hold the starting position of the path.

startY : real

These properties hold the starting position of the path.