[Interest] QML function super call

Michael Brasser michael.brasser at live.com
Thu May 22 15:09:43 CEST 2014


Hi,
For reference, this issue is logged as https://bugreports.qt-project.org/browse/QTBUG-25942.

Regards,Michael

> From: wolfgang.baron at gmx.net
> To: interest at qt-project.org
> Date: Thu, 22 May 2014 11:42:07 +0200
> Subject: [Interest] QML function super call
> 
> 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?
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140522/eac1feec/attachment.html>


More information about the Interest mailing list