PathRectangle QML Type

角が丸い矩形を定義します。詳細...

Import Statement: import QtQuick
Since: QtQuick 6.8

プロパティ

詳しい説明

PathRectangle は矩形を指定する簡単な方法を提供します。API はRectangle の項目に対応しています。

Path,PathLine,PathQuad,PathCubic,PathArc,PathAngleArc,PathCurve,PathSvgも参照して ください。

プロパティ文書

x : real

y : real

矩形の左上の角を定義します。

こ の角が丸 く さ れていない限 り 、 こ れはパ ス の始点 と 終点 と な り ます。

relativeXrelativeYも参照してください


relativeX : real

relativeY : real

パスの開始点に対する相対的な矩形の左上隅を定義する。

相対位置 と 絶対位置の両方の終了位置が 1 つの軸に指定 さ れてい る と き は、 相対位置が用い ら れます。

相対位置 と 絶対位置は混在可能であ り 、 た と えば相対 x と 絶対 y を設定する こ と も 有効です。

x およびyも参照


height : real

width : real

矩形の幅 と 高 さ を定義 し ます。

x およびyも参照してください


bottomLeftRadius : real

bottomRightRadius : real

topLeftRadius : real

topRightRadius : real

設定されている場合、これらのプロパティは個々のコーナー半径を定義します。値がゼロの場合、そのコーナーは鋭角であると定義され、正の値の場合、そのコーナーは丸みを帯びていると定義されます。設定されていない場合、radius の値が代わりに使用されます。

これらのプロパティはデフォルトでは設定されていません。undefined を代入すると、未設定状態に戻ります。

radiusも参照してください


radius : real

このプロパティは、丸みを帯びた長方形を定義するために使用される角の半径を定義します。

半径が正の値の場合、矩形パスは丸みを帯びた矩形として定義され、そうでない場合は通常の矩形として定義されます。

こ のプ ロパテ ィ は、 個々の隅の半径プ ロパテ ィ に よ っ て上書きす る こ と も で き ます。

topLeftRadiustopRightRadiusbottomLeftRadiusbottomRightRadiusも参照


strokeAdjustment : real

このプロパティは、矩形座標に対するストローク幅の調整を定義します。

ストロ ークが有効なShapePath で用い ら れ る と 、 実際の ス ト ロ ー ク 矩形はデフ ォ ル ト では、 定義 さ れた矩形を超え て、 全辺に対 し て ス ト ロー ク 幅の半分だけ広が り ます。パスが描線の中点線を定義し、QPainter と SVG レンダリングに対応しているので、これは期待される動作です。

その代わりに、Rectangle のボーダー付きアイテムのように、定義された矩形をストロークされた矩形の外縁にしたい場合、strokeAdjustment をストローク幅に設定することができます。これにより、すべてのエッジがストローク幅の半分だけ内側にシフトされます。次の例のように:

ShapePath {
    id: myRec
    fillColor: "white"
    strokeColor: "black"
    strokeWidth: 16
    joinStyle: ShapePath.MiterJoin

    PathRectangle { x: 10; y: 10; width: 200; height: 100; strokeAdjustment: myRec.strokeWidth }
}

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