rect QML Value Type
x, y, 너비 및 높이 속성이 있는 값입니다. 더 보기...
상세 설명
rect
유형은 x
, y
, width
및 height
속성이 있는 값을 나타냅니다.
rect
유형의 속성은 기본적으로 Qt.rect(0, 0, 0, 0)
입니다. 좌표 원점의 빈 직사각형입니다.
예를 들어 Item childrenRect 직사각형 유형 속성의 width
및 height
값을 읽으려면 다음과 같이 지정합니다:
Rectangle { width: childrenRect.width height: childrenRect.height Rectangle { width: 100; height: 100 } }
rect
값을 만들려면 "x, y, 너비 x 높이" 문자열로 지정합니다:
CustomObject { myRectProperty: "50,50,100x100" }
또는 Qt.rect() 함수를 사용합니다:
CustomObject { myRectProperty: Qt.rect(50, 50, 100, 100) }
rect
유형은 읽기 전용 left
, right
, top
및 bottom
속성도 노출합니다. 이는 C++ counterparts 와 동일합니다.
C++와 통합할 때 C++에서 QML로 전달된 QRect 또는 QRectF 값은 자동으로 rect
값으로 변환되며, 그 반대의 경우도 마찬가지입니다. rect
값이 C++로 전달되면 QRectF 값으로 자동 변환됩니다.
QML 값 유형도참조하세요 .
© 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.