Hi, I would like to have equivalent of compile time polymorphism in in 
Qml. a.k.a function overriding.

I know inheritance can be obtained by including the base-class in derived 
class. (A realisation of the principle called inheritance by composition)
I also want to have some default implementations of the baseclass to be 
available and invoked, in case the derived class does not provide its own 
implementation.
In Qml sense, a method is function. So

Base.qml
-----
Item
{
   function method1()
   {
   }
}

Derived.qml (in same folder as base.qml)
------
Item
{
  Base
  {
    id: base
  }
}

SomeOtherQml.qml
---
..
  Derived { id: derived1 ... }
.. else where in this file,
   derived1.method1() - should call, Base::method1, because derived1 does 
not re-implement it (in the sense of inheritance)



_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to