[Kde-java] Signals and Slots implemented in Java

Marco Ladermann ladermann at hbg.dpa.de
Tue Oct 21 10:58:46 CEST 2003


Am Montag, 20. Oktober 2003 17:10 schrieb Marco Ladermann:
> This seems to be a good idea: have a interface for all signals (and another
> one for the slots) build by classname and appended "Signals" ("Slots"). 
> But even if the lookup in the inheritance hierachy is simple, the user has
> still to know in which super class the interface is defined to call the
> appropriate signal method. The Proxy must be casted to this interface. What
> about also requiring that the super signal interface must be extended by
> the current class signal interface?

One problem here: If one defines no new signals in a class, an extended 
version of this class with signals must extend the grandparents signal 
interface. Arrg.

But we could leave out the classname from the signal interface like this:

public class MyWidget extends QSuper {
  public interface Signals extends QSuper.Signals {
    ...
  }
}

the above mentioned problem should then be solved.

One further problem with the extends approach might be that the private 
signals of a super class are imported in the current class, but I think this 
can be cecked in the "connect" or "emit".

Marco
-- 



More information about the Kde-java mailing list