PathRectangle QML Type
선택적으로 모서리가 둥근 직사각형을 정의합니다. 더 보기...
Import Statement: | import QtQuick |
Since: | QtQuick 6.8 |
속성
- bevel : bool
(since 6.10)
- bottomLeftBevel : bool
- bottomLeftRadius : real
- bottomRightBevel : bool
- bottomRightRadius : real
- height : real
- radius : real
- relativeX : real
- relativeY : real
- strokeAdjustment : real
- topLeftBevel : bool
- topLeftRadius : real
- topRightBevel : bool
- topRightRadius : real
- width : real
- x : real
- y : real
자세한 설명
PathRectangle은 모서리가 둥글거나 비스듬한 직사각형을 쉽게 지정할 수 있는 방법을 제공합니다. 이 API는 Rectangle 항목에 해당합니다.
Shape { id: rectangleShape width: 200 height: 150 anchors.centerIn: parent preferredRendererType: Shape.CurveRenderer ShapePath { fillColor: "#3ad23c" PathRectangle { width: rectangleShape.width height: rectangleShape.height topLeftRadius: 30 bottomRightRadius: 30 bevel: true } } }
Path, PathLine, PathQuad, PathCubic, PathArc, PathAngleArc, PathCurve, PathSvg 를참조하세요 .
속성 문서
이 속성을 설정하면 개별 모서리 반경을 정의합니다. 0 값은 모서리를 날카롭게 정의하고 양수 값은 모서리를 둥글게 정의합니다. 설정하지 않으면 radius 값이 대신 사용됩니다.
이러한 속성은 기본적으로 설정되지 않습니다. 설정 해제 상태로 되돌리려면 undefined
을 지정하세요.
다음 예제에서 radius 는 10
로, topLeftRadius
는 0
로 설정되어 있습니다:
Shape { id: rectangleShape width: 200 height: 150 anchors.centerIn: parent preferredRendererType: Shape.CurveRenderer ShapePath { strokeColor: "black" strokeWidth: 4 joinStyle: ShapePath.MiterJoin PathRectangle { width: rectangleShape.width height: rectangleShape.height radius: 10 topLeftRadius: 0 bottomRightBevel: true } } }
radius 를참조하세요 .
설정된 경우 이 속성은 개별 모서리 경사를 정의합니다. false
로 설정하면 개별 radius 속성의 값에 따라 모서리가 날카롭거나 둥글게 됩니다. true
로 설정하면 모서리가 경사진 모서리가 됩니다. 설정하지 않으면 bevel 값이 대신 사용됩니다.
이러한 속성은 기본적으로 설정되지 않습니다. 설정 해제 상태로 되돌리려면 undefined
을 지정합니다.
다음 예에서는 bottomRightBevel
이 true로 설정되어 있습니다:
Shape { id: rectangleShape width: 200 height: 150 anchors.centerIn: parent preferredRendererType: Shape.CurveRenderer ShapePath { strokeColor: "black" strokeWidth: 4 joinStyle: ShapePath.MiterJoin PathRectangle { width: rectangleShape.width height: rectangleShape.height radius: 10 topLeftRadius: 0 bottomRightBevel: true } } }
bevel 를참조하세요 .
bevel : bool |
이 속성은 직사각형의 모서리가 기울어져 있는지 여부를 정의합니다.
false
로 설정하면 개별 radius 속성의 값에 따라 모서리가 날카롭거나 둥글게 됩니다.
이 속성은 개별 기울기 속성으로 재정의할 수 있습니다.
Shape { id: rectangleShape width: 200 height: 150 anchors.centerIn: parent preferredRendererType: Shape.CurveRenderer ShapePath { fillColor: "#3ad23c" PathRectangle { width: rectangleShape.width height: rectangleShape.height topLeftRadius: 30 bottomRightRadius: 30 bevel: true } } }
이 프로퍼티는 Qt 6.10에 도입되었습니다.
topLeftBevel, topRightBevel, bottomLeftBevel, bottomRightBevel 을참조하십시오 .
radius : real |
이 속성은 둥근 직사각형을 정의하는 데 사용되는 모서리 반경을 정의합니다.
반경이 양수 값이면 직사각형 경로가 둥근 직사각형으로 정의되고, 그렇지 않으면 일반 직사각형으로 정의됩니다.
이 속성은 개별 모서리 반경 속성에 의해 재정의될 수 있습니다.
기본값은 0
입니다.
topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius 을참조하세요 .
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.