읽기 전용 속성

이 경고 범주의 철자는 [read-only-property] 입니다.

읽기 전용 속성에 할당할 수 없습니다.

무슨 일인가요?

읽기 전용 속성이 작성되었습니다.

이것이 왜 나쁜가요?

QML 엔진은 읽기 전용 속성에 대한 쓰기를 감지하면 유형 오류를 발생시킵니다.

예제

import QtQuick

Item {
    id: root
    readonly property int someNumber: 10

    Component.onCompleted: {
        someNumber = 20  // not ok: TypeError: Cannot assign to read-only property
    }
}

이 경고를 해결하려면 읽기 전용 속성에 대한 쓰기를 제거하거나, 읽기 전용이 아닌 다른 속성에 쓰거나, 속성 정의의 작성자인 경우 읽기 전용 수정자를 제거하세요.

읽기 전용 속성도 참조하세요 .

© 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.