size QML Value Type
너비 및 높이 속성이 있는 값입니다. 더 보기...
상세 설명
size
유형은 width
및 height
속성이 있는 값을 나타냅니다.
size
유형의 속성에는 Qt.size(-1, -1)
이 기본값으로 지정됩니다.
예를 들어 Image::sourceSize 크기 유형 속성의 width
및 height
값을 읽으려면 다음과 같이 지정합니다:
Column { Image { id: image; source: "logo.png" } Text { text: image.sourceSize.width + "," + image.sourceSize.height } }
size
값을 만들려면 "너비 x 높이" 문자열로 지정합니다:
Image { sourceSize: "150x50" }
또는 Qt.size() 함수를 사용합니다:
Image { sourceSize: Qt.size(150, 50) }
C++와 통합할 때 C++에서 QML로 전달된 QSize 또는 QSizeF 값은 자동으로 size
값으로 변환되며, 그 반대의 경우도 마찬가지입니다. size
값이 C++로 전달되면 QSizeF 값으로 자동 변환됩니다.
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.