읽기 전용 속성
qmllint에서는 이 경고 범주를 ' [read-only-property] '로 표기합니다.
읽기 전용 속성에 값을 할당할 수 없음
무슨 일이 발생했나요?
읽기 전용 속성에 값이 할당되었습니다.
왜 문제가 될까요?
QML 엔진은 읽기 전용 속성에 대한 쓰기 시도를 감지하면 TypeError를 발생시킵니다.
예시
import QtQuick
Item {
id: root
readonly property int someNumber: 10
Component.onCompleted: {
someNumber = 20 // not ok: TypeError: Cannot assign to read-only property
}
}이 경고를 해결하려면, 읽기 전용 속성에 대한 쓰기 작업을 제거하거나, 읽기 전용이 아닌 다른 속성에 쓰기를 수행하거나, 해당 속성 정의의 작성자인 경우 readonly 수식어를 제거하십시오.
‘읽기 전용 속성’항목도 참조하십시오 .
© 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.