I'm pretty sure the answer is no, but I thought I should ask anyway. Can an inherited property be made readonly/constant in a pure QML derived class?
// Base.qml
Item {
property int foo: 42
}
// Derived.qml
Base {
foo: 99 // Make constant somehow!
}
I'm currently tackling this by detecting a change in foo
and printing an error to the console, but that's hardly a mark of good API...
I have a menu item class which can represent menu entries, submenus, separators, etc. I need to specialise it's behaviour, but only for when it is in submenu mode. I can change the inheritance tree so I have a subclass for each menu type, but this seems silly as each subclass will only contain a single readonly
property. However if there isn't another way, I will have to.