구성 요소에 필수 속성이 누락되었습니다
qmllint에서는 이 경고 범주를 ‘ [required] ’으로 표기합니다.
컴포넌트에 필수 속성이 누락되었습니다
무슨 일이 발생했나요?
컴포넌트의 필수 속성이 설정되지 않았습니다.
이것이 왜 문제인가요?
필수 속성이 누락된 컴포넌트가 포함된 QML 애플리케이션은 오작동을 일으킵니다. 누락된 필수 속성이 정적으로 감지되면 애플리케이션이 아예 시작되지 않습니다. 필수 속성이 누락된 동적으로 생성된 컴포넌트는 런타임에 생성되지 않고 대신 null로 처리됩니다.
예시
import QtQuick
Item {
component RepeatMe: Item {
required property int index;
required property int helloWorld;
}
RepeatMe {} // not ok: required properties index and helloWorld not set
Repeater {
model: 10
RepeatMe {} // not ok: required property index set by Repeater, but not helloWorld
}
}이 경고를 해결하려면 필수 속성을 설정하십시오:
import QtQuick
Item {
component RepeatMe: Item {
required property int index;
required property int helloWorld;
}
RepeatMe {
index: 0
helloWorld: 42
} // ok: all required properties were set
Repeater {
model: 10
RepeatMe {
helloWorld: index * 2 + 1
} // ok: all required properties were set: index by the Repeater and helloWorld by the user
}
}참조: 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.