[Interest] QML function super call

Wolfgang Baron wolfgang.baron at gmx.net
Thu May 22 11:42:07 CEST 2014


How can I call the function implementation in a base class, if the class overrides the definition? Here is an example:


Base.qml:
-------------------
import QtQuick 2.2

Item {
function myFunc() {
console.log( "Base myFunc called" );
}
}
-------------------


Derived.qml:
-------------------
import QtQuick 2.2

Base {
function myFunc() {
console.log( "Derived myFunc called" );
// the following line does not work. How to call myFunc in Base?
Base.myFunc();
}
}
-------------------


Without the Base.myFunc(), code like this works, thus you can ovveride function implementations. However, calling the baseclass's implementation is often very important. I have not found any mentioning of this in the documentation, but maybe I have just not found it. Any ideas?



More information about the Interest mailing list