このページでは

PathPercent QML Type

パスの解釈方法を操作します。詳細...

Import Statement: import QtQuick

プロパティ

詳細説明

PathPercent を使用すると、PathView のパス上のアイテム間の間隔を調整できます。これにより、パスの特定の部分ではアイテムを密集させ、他の部分では間隔を広げるといった設定が可能です。

以下の例は、パスに沿ったアイテムの通常の配置と、パスのPathLine セクションに沿ってアイテムの50%を配置した場合の配置を比較したものです。

S字型の経路に沿って項目が均等に配置されたPathView

PathView {
    // ...
    Path {
        startX: 20; startY: 0
        PathQuad { x: 50; y: 80; controlX: 0; controlY: 80 }
        PathLine { x: 150; y: 80 }
        PathQuad { x: 180; y: 0; controlX: 200; controlY: 80 }
    }
}

PathView:項目の50%が中央のPathLineセクションに沿って集中している

PathView {
    // ...
    Path {
        startX: 20; startY: 0
        PathQuad { x: 50; y: 80; controlX: 0; controlY: 80 }
        PathPercent { value: 0.25 }
        PathLine { x: 150; y: 80 }
        PathPercent { value: 0.75 }
        PathQuad { x: 180; y: 0; controlX: 200; controlY: 80 }
        PathPercent { value: 1 }
    }
}

「Path」も参照してください 。

プロパティのドキュメント

value : real

この時点までにレイアウトすべき項目の割合。

この値は、パス上の前の位置でPathPercent によって指定された最後の値よりも常に大きくなければなりません。

次の例では、3 つの PathLine で構成される Path があります。 通常、PathView のアイテムは、このパスに沿って均等に配置され、各線分ごとに等しい数のアイテムが配置されます。PathPercent を使用すると、1番目と3番目の線分にはそれぞれ配置されるアイテムの10%を、2番目の線分には残りの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.