[Interest] Qml javascript super keyword

Jérôme Godbout jerome at bodycad.com
Wed Sep 16 17:09:35 CEST 2015


Hi,
anybody know if there's a way to have the *super* keyword (ES6
specification) equivalent into a qml script? I have seen the signal
workaround (see link below), but sadly this does not get reevaluated like
functions parameters, it only get called once which is not correct with
what I want to do.

I don't expect anything until super is introduced into Qml javascript but
if anybody have a way I would be grateful.

When can we expect to have the super keyword support into Qml?

Super keyword info:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/super

Signal workaround, but is imperative and cannot really be used inside a
binding like function can right now
https://forum.qt.io/topic/10265/solved-how-to-call-parent-qml-screen-s-javascript-function/4

https://bugreports.qt.io/browse/QTBUG-25942
This is the related bug

basic example:
A.qml
Item
{
  function toto()
  {
    return "base toto";
  }
}

B.qml
A
{
   function toto()
   {
     return "a non " + super.toto(); // or any equivalent to the
super.toto()
   }
}

Thanks,
Jerome
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150916/0f854b07/attachment.html>


More information about the Interest mailing list