PathPercent QML Type
控制路径的解析方式。更多...
| Import Statement: | import QtQuick |
属性
- value : real
详细说明
PathPercent 允许您调整“路径”(PathView )上项目之间的间距。您可以利用它将路径某一段上的项目集中排列,而在路径的其他部分则将它们分散开来。
下面的示例展示了项目沿路径的常规分布,并与将 50% 的项目放置在路径中“PathLine ”段上的分布进行了对比。
| |
| |
另请参阅 Path 。
属性文档
value : real
截至当前位置应排版的项目比例。
该值应始终大于路径中先前位置由PathPercent 指定的最后一个值。
在下面的示例中,我们有一个由三条 PathLines 组成的 Path。 通常情况下,PathView 的项目会沿此路径均匀分布,每段路径上的项目数量相等。PathPercent 允许我们指定第一段和第三段各包含 10% 的项目,而第二段则包含剩余的 80%。
PathView {
// ...
Path {
startX: 0; startY: 0
PathLine { x:100; y: 0; }
PathPercent { value: 0.1 }
PathLine { x: 100; y: 100 }
PathPercent { value: 0.9 }
PathLine { x: 100; y: 0 }
PathPercent { value: 1 }
}
}© 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.

