It seems like although QML supports \"overriding\" of properties and functions, the support is somewhat clunky. Here is an example snippet:
// T1.qml
QtObjec
Found one simple and naive manual solution:
// T1.qml
QtObject {
function f() { return f_t1() }
function f_t1() { return 1 }
}
// T2.qml
T1 {
function f() { return f_t2() }
function f_t2() { return f_t1() + " blah " }
}
// usage
T2 {
function f() { return f_t2() + 1.5}
Component.onCompleted: console.log(f()) // outputs 1 blah 1.5
}
In short, have explicitly named function for every level of the "inheritance" that overrides, and use the non-decorated function override for polymorphic access, thus now the "base" type implementations can be reused by the derived.