This warning category is spelled
[read-only-property]
by qmllint.
A read-only property was written.
The QML engine will throw a Type Error when it sees the write to a read-only property.
import QtQuick Item { id: root readonly property int someNumber: 10 Component.onCompleted: { someNumber = 20 // not ok: TypeError: Cannot assign to read-only property } }
To fix this warning, remove the write to the read-only property, write to another non-read-only property, or remove the readonly modifier if you are the author of the property definition.
另请参阅 Read-Only Properties .