size QML Value Type
width 및 height 속성이 지정된 값. 더 보기...
| Import Statement: | import QtQml |
상세 설명
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 값 유형도 참조하십시오 .
© 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.