Can D be cute? (Qt)

Lutger lutger.blijdestijn at gmail.com
Sat May 8 08:04:04 PDT 2010


Marianne Gagnon wrote:

> Hi Justin,
> 
> looking at QtD, it seems like it can be done :
> 
> In file
> 
http://www.dsource.org/projects/qtd/browser/demos/browser/browsermainwindow.d
> 
>         m_historyHome.triggered().connect(&this.slotHome);
> 
>         // ...
> 
>  public:
> 
>  void slotHome()
>  {
>  // ...
> }
> 
> I however believe that this kind of delegate-connection can also be
> performed in C++ (with templates?). Maybe Qt developers simply continue
> using the MOC because they don't want to break backwards compatibility.
> 
> -- Auria

Yes, but there is another reason: the signal/slot design is part of the 
reflection system that MOC generates. The idea is that this makes it more  
flexible and dynamic. For example you hook signal / slots in their gui 
designer or expose them as a dbus api, provide easy scripting access, etc.


More information about the Digitalmars-d mailing list