本页内容

PathLine QML Type

定义一条直线。更多...

Import Statement: import QtQuick

属性

详细说明

下面的示例创建了一条从 (0, 100) 到 (200, 100) 的直线:

Path {
    startX: 0; startY: 100
    PathLine { x: 200; y: 100 }
}

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

属性文档

relativeX : real

relativeY : real

定义了线段相对于其起点的终点。

如果为单个轴同时指定了相对和绝对的终点位置,则将使用相对位置。

相对位置和绝对位置可以混合使用,例如,设置相对的 x 位置和绝对的 y 位置是有效的。

另请参阅 x 和y 。

x : real

y : real

定义线的终点。

另请参阅 relativeX 和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.