구성 요소는 정확히 하나의 자식 요소를 가져야 합니다
qmllint에서는 이 경고 범주를 ‘ [component-children-count] ’라고 표기합니다.
컴포넌트에는 정확히 하나의 자식 요소가 있어야 합니다
무슨 일이 발생했나요?
컴포넌트의 자식 개수가 잘못되었습니다. 자식은 정확히 하나여야 합니다.
왜 문제가 될까요?
파일의 루트 컴포넌트를 인스턴스화할 수 없게 되어 런타임에 오류가 발생합니다.
예시
Component {
Rectangle {
width: 50
height: 50
color: "red"
}
Rectangle {
width: 50
height: 50
color: "blue"
}
}이 경고를 해결하려면 컴포넌트의 자식 요소가 정확히 하나인지 확인하십시오. 자식 요소가 없는 경우 자식 요소를 추가하십시오. 자식 요소가 여러 개인 경우, 초과된 자식 요소를 제거하거나 자식 요소들을 컴포넌트의 단일 최상위 자식 요소로 감싸십시오.
© 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.